hc
2024-08-16 62c46c9150c4afde7e5b25436263fddf79d66f0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * Copyright (C) 2013 Spreadtrum Communications Inc.
 *
 * Filename : npi.h
 * Abstract : This file is a general definition for NPI cmd
 *
 * Authors    :
 * Xianwei.Zhao <xianwei.zhao@spreadtrum.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
 
#ifndef __SPRDWL_NPI_H__
#define __SPRDWL_NPI_H__
 
#define SPRDWL_NL_GENERAL_SOCK_ID    (1022)
#define SPRDWL_NPI_CMD_START        (0)
#define SPRDWL_NPI_CMD_SET_WLAN_CAP    (40)
#define SPRDWL_STA_GC_EN_SLEEP        (0x3)
#define SPRDWL_STA_GC_NO_SLEEP        (0x0)
#define SPRDWL_PSM_PATH            "/opt/etc/.psm.info"
#define SPRDWL_NPI_CMD_GET_CHIPID    (136)
 
#define SPRDWL_NPI_CMD_SET_PROTECTION_MODE 50
#define SPRDWL_NPI_CMD_GET_PROTECTION_MODE 51
#define SPRDWL_NPI_CMD_SET_RTS_THRESHOLD   52
 
/* enable: 0x0
 * disable: 0x1
 * STA: bit 0
 * GC: bit 1
 */
enum sprdwl_nl_commands {
   SPRDWL_NL_CMD_UNSPEC,
   SPRDWL_NL_CMD_NPI,
   SPRDWL_NL_CMD_GET_INFO,
   SPRDWL_NL_CMD_MAX,
};
 
enum sprdwl_nl_attrs {
   SPRDWL_NL_ATTR_UNSPEC,
   SPRDWL_NL_ATTR_IFINDEX,
   SPRDWL_NL_ATTR_AP2CP,
   SPRDWL_NL_ATTR_CP2AP,
   SPRDWL_NL_ATTR_MAX,
};
 
struct sprdwl_npi_cmd_hdr {
   unsigned char type;
   unsigned char subtype;
   unsigned short len;
} __packed;
 
struct sprdwl_npi_cmd_resp_hdr {
   unsigned char type;
   unsigned char subtype;
   unsigned short len;
   int status;
} __packed;
 
enum sprdwl_npi_cmd_type {
   SPRDWL_HT2CP_CMD = 1,
   SPRDWL_CP2HT_REPLY,
};
 
void sprdwl_init_npi(void);
void sprdwl_deinit_npi(void);
#endif /*__NPI_H__*/