Go back –> ath6kl
ath6kl todo
Contents
- Side cleanups
-
Addressing private commands
- Understanding how ath6kl uses private ioctls
- standard private ioctls...
- private ioctls
-
xioctls
- BMI commands
- Historical Host-side DataSet support
- Misc Extended Ioctls
- HTC Raw Interface ioctls
- GPIO Extended ioctls
- More wireless commands
- Radio test commands
- More random commands
- ROM Patching ioctls
- More wireless stuff
- Bluetooth commands
- more random stuff
- WoW ioctls
- More commands
- AP mode
- More BT coex
- More random stuff on wireless
- 155 - 160 undefined
- some last command
- Android
- config cleanup
- AP Mode support using cfg80211
- WiFi Direct
Side cleanups
- Multi architecture support (64 bit)
- Bi-endian support (big endian)
Addressing private commands
Luis is working on this. This section is going to be extended as time goes by. This section will provide recipes of what needs to get done.
Understanding how ath6kl uses private ioctls
The Linux kernel now uses cfg80211 for any new driver. cfg80211 takes care of wireless-extensions for older drivers, so drivers do not need to register their own wireless-extensions at all. Private wireless extensions also cannot be supported by design. This section documents what needs to get done to replace properly these older APIs to allow us to get the driver into proper placement into the Linux kernel.
This initial section will document how the private handlers are used in the driver and defined.
Typically with the older wireless-extensions drivers are allowed to use private wireless extensions. Wireless extensions essentially allowed the netdev to use some specific ioctl()s for wireless device manipulation. If the driver needed to use private definitions of their own (private commands) they would then define their own private handlers as part of wireless-extensions in a way similar to this:
const struct iw_handler_def prism54_handler_def = {
.num_standard = ARRAY_SIZE(prism54_handler),
.num_private = ARRAY_SIZE(prism54_private_handler),
.num_private_args = ARRAY_SIZE(prism54_private_args),
.standard = (iw_handler *) prism54_handler,
.private = (iw_handler *) prism54_private_handler,
.private_args = (struct iw_priv_args *) prism54_private_args,
.get_wireless_stats = prism54_get_wireless_stats,
};However ath6kl does not use of wireless-extensions private extensions... it makes use of the standard netdev ndo_do_ioctl callback as follows:
static struct net_device_ops ar6000_netdev_ops = {
.ndo_init = NULL,
.ndo_open = ar6000_open,
.ndo_stop = ar6000_close,
.ndo_get_stats = ar6000_get_stats,
.ndo_do_ioctl = ar6000_ioctl,
.ndo_start_xmit = ar6000_data_tx,
.ndo_set_multicast_list = ar6000_set_multicast_list,
};It is important to understand how ath6kl uses this ioctl in order to properly address how the private commands can be addressed. ar6000_ioctl() furthermore splits received ioctls into 3 categies:
Standard wireless-extensions commands
Private wireless-extensions
Some further extensions ath6kl calls xioctls...
Now each of these will only be allowed if and only if the respective secondary command passed was designed to operate on the current mode of operation.
standard private ioctls...
It is completely useless to support standard wireless-extensions piggy backed ontop of the generic netdev ioctl given that wireless-extensions already supports the standard wireless-extensions. This support should be removed.
private ioctls
Unfortunately there are 191 private commands in total and they are all scattered throughout "private ioctls" as we are used to them, or through xioctls which is a mechanism to enable even more ioctls. All of the commands are pretty scattered throughout the ath6kl netdev ioctl commands but for each and every one of these we need to evaluate as follows:
- document what they do
- who uses these?
- do we really want to support them?
- are these users comfortable in using debugfs for this?
We need to address each one and what we should do for cfg80211, so far, these seem to not be very generic, so for generic value get/set we should evaluate for example if we can just use debugfs. Whether we can or not use debugfs will be determined by who are the users of these commands.
General private commands
0 - IEEE80211_IOCTL_SETPARAM
This gets a parameter and an associated value which is desired to be set. Both are ints, and they are passed to ar6000_ioctl_setparam(). The parameters supported are:
For AP mode of operation:
- IEEE80211_PARAM_WPA: can be WPA, WPA2, both WPA and WPA2, or none.
- IEEE80211_PARAM_AUTHMODE:
- IEEE80211_PARAM_UCASTCIPHER:
- IEEE80211_PARAM_PRIVACY:
IEEE80211_PARAM_WAPI: See WAPI cfg80211 AP API – are there really customers / users of WAPI on AR6003 in AP mode?
For STA mode of operation:
- IEEE80211_PARAM_WPA: this can be WPA_AUTH, WPA2_AUTH, NONE_AUTH
- IEEE80211_PARAM_AUTHMODE: this can be IEEE80211_AUTH_[WPA_PSK|WPA_CCKM]. For WPA_PSK this will be WPA_PSK_AUTH or WPA2_PSK_AUTH. For WPA_CCKM this will be WPA2_AUTH_CCKM or WPA_AUTH_CCKM.
- IEEE80211_PARAM_UCASTCIPHER: this can be AES_CRYPT, TKIP_CRYPT, WEP_CRYPT, NONE_CRYPT
- IEEE80211_PARAM_UCASTKEYLEN: the length of the unicast key length
- IEEE80211_PARAM_MCASTCIPHER: this can be AES_CRYPT, TKIP_CRYPT, WEP_CRYPT, NONE_CRYPT
- IEEE80211_PARAM_MCASTKEYLEN: the length of the multicast key length
- IEEE80211_PARAM_COUNTERMEASURES: used for configuring the TKIP countermeasures.
1 - IEEE80211_IOCTL_SETKEY
XXX: Read code.
2 - IEEE80211_IOCTL_DELKEY
XXX: Read code.
3 - IEEE80211_IOCTL_SETMLME
XXX: Read code.
4 - IEEE80211_IOCTL_ADDPMKID
XXX: Read code.
5 - IEEE80211_IOCTL_SETOPTIE
XXX: Read code.
6 - IEEE80211_IOCTL_GETPARAM unused
XXX: Read code.
7 - IEEE80211_IOCTL_SETWMMPARAMS unused
XXX: Read code.
8 - IEEE80211_IOCTL_GETWMMPARAMS unused
XXX: Read code.
9 - IEEE80211_IOCTL_GETOPTIE unused
XXX: Read code.
10 - IEEE80211_IOCTL_SETAUTHALG unused
XXX: Read code.
10 - IEEE80211_IOCTL_LASTONE
XXX: Read code. Yes 10... again. This is not documented, gotta read the code.
WMI commands
11 - AR6000_IOCTL_WMI_GETREV
XXX: Read code.
12 - AR6000_IOCTL_WMI_SETPWR
XXX: Read code.
13 - AR6000_IOCTL_WMI_SETSCAN
XXX: Read code.
14 - AR6000_IOCTL_WMI_SETLISTENINT
XXX: Read code.
15 - AR6000_IOCTL_WMI_SETBSSFILTER
XXX: Read code.
16 - AR6000_IOCTL_WMI_SET_CHANNELPARAMS
XXX: Read code.
17 - AR6000_IOCTL_WMI_SET_PROBEDSSID
XXX: Read code.
18 - AR6000_IOCTL_WMI_SET_PMPARAMS
XXX: Read code.
19 - AR6000_IOCTL_WMI_SET_BADAP
XXX: Read code.
20 - AR6000_IOCTL_WMI_GET_QOS_QUEUE
XXX: Read code.
21 - AR6000_IOCTL_WMI_CREATE_QOS
XXX: Read code.
22 - AR6000_IOCTL_WMI_DELETE_QOS
XXX: Read code.
23 - AR6000_IOCTL_WMI_SET_SNRTHRESHOLD
XXX: Read code.
24 - AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK
XXX: Read code.
25 - AR6000_IOCTL_WMI_GET_TARGET_STATS
XXX: Read code.
26 - AR6000_IOCTL_WMI_SET_ASSOC_INFO
XXX: Read code.
27 - AR6000_IOCTL_WMI_SET_ACCESS_PARAMS
XXX: Read code.
28 - AR6000_IOCTL_WMI_SET_BMISS_TIME
XXX: Read code.
29 - AR6000_IOCTL_WMI_SET_DISC_TIMEOUT
XXX: Read code.
30 - AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS
XXX: Read code.
31 - AR6000_IOCTL_EXTENDED
This is used as nasty hack to allow the driver to expose more than 30 private ioctls on the netdev data structure. Further sub commands make use of the next x bits (XXX: review how many bits was used).
xioctls
Linux wireless-extensions only supports 30 private ioctls. The supported way to add more ioctls was to use subioctls, instead ath6kl decided to redefine the concept of subioctls but on the netdev ioctl... It accomplishes this by defining an extended ioctl command which is also mapped as follows:
/* * There is a very small space available for driver-private * wireless ioctls. In order to circumvent this limitation, * we multiplex a bunch of ioctls (XIOCTLs) on top of a * single AR6000_IOCTL_EXTENDED ioctl. */ #define AR6000_IOCTL_EXTENDED (SIOCIWFIRSTPRIV+31)
Below we categorize them. It seems we can likely just move these knobs to debugfs. An evaluation needs to be done to determine if users of these APIs would be happy in using debugfs.
BMI commands
1 - AR6000_XIOCTL_BMI_DONE
2 - AR6000_XIOCTL_BMI_READ_MEMORY
3 - AR6000_XIOCTL_BMI_WRITE_MEMORY
4 - AR6000_XIOCTL_BMI_EXECUTE
5 - AR6000_XIOCTL_BMI_SET_APP_START
6 - AR6000_XIOCTL_BMI_READ_SOC_REGISTER
7 - AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER
8 - AR6000_XIOCTL_BMI_TEST
Historical Host-side DataSet support
9 - AR6000_XIOCTL_UNUSED9
10 - AR6000_XIOCTL_UNUSED10
11 - AR6000_XIOCTL_UNUSED11
Misc Extended Ioctls
12 - AR6000_XIOCTL_FORCE_TARGET_RESET
HTC Raw Interface ioctls
13 - AR6000_XIOCTL_HTC_RAW_OPEN
14 - AR6000_XIOCTL_HTC_RAW_CLOSE
15 - AR6000_XIOCTL_HTC_RAW_READ
16 - AR6000_XIOCTL_HTC_RAW_WRITE
17 - AR6000_XIOCTL_CHECK_TARGET_READY
GPIO Extended ioctls
18 - AR6000_XIOCTL_GPIO_OUTPUT_SET
19 - AR6000_XIOCTL_GPIO_INPUT_GET
20 - AR6000_XIOCTL_GPIO_REGISTER_SET
21 - AR6000_XIOCTL_GPIO_REGISTER_GET
22 - AR6000_XIOCTL_GPIO_INTR_ACK
23 - AR6000_XIOCTL_GPIO_INTR_WAIT
More wireless commands
24 - AR6000_XIOCTL_SET_ADHOC_BSSID
25 - AR6000_XIOCTL_SET_OPT_MODE
26 - AR6000_XIOCTL_OPT_SEND_FRAME
27 - AR6000_XIOCTL_SET_BEACON_INTVAL
28 - IEEE80211_IOCTL_SETAUTHALG
29 - AR6000_XIOCTL_SET_VOICE_PKT_SIZE
30 - AR6000_XIOCTL_SET_MAX_SP
31 - AR6000_XIOCTL_WMI_GET_ROAM_TBL
32 - AR6000_XIOCTL_WMI_SET_ROAM_CTRL
33 - AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS
34 - AR6000_XIOCTRL_WMI_GET_POWER_MODE
Why not just use the standard commands?!
35 - AR6000_XIOCTRL_WMI_SET_WLAN_STATE
36 - AR6000_XIOCTL_WMI_GET_ROAM_DATA
37 - AR6000_XIOCTL_WMI_SETRETRYLIMITS
Radio test commands
38 - AR6000_XIOCTL_TCMD_CONT_TX
39 - AR6000_XIOCTL_TCMD_CONT_RX
40 - AR6000_XIOCTL_TCMD_PM
More random commands
41 - AR6000_XIOCTL_WMI_STARTSCAN
42 - AR6000_XIOCTL_WMI_SETFIXRATES
43 - AR6000_XIOCTL_WMI_GETFIXRATES
44 - AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD
45 - AR6000_XIOCTL_WMI_CLR_RSSISNR
46 - AR6000_XIOCTL_WMI_SET_LQTHRESHOLD
47 - AR6000_XIOCTL_WMI_SET_RTS
48 - AR6000_XIOCTL_WMI_SET_LPREAMBLE
49 - AR6000_XIOCTL_WMI_SET_AUTHMODE
50 - AR6000_XIOCTL_WMI_SET_REASSOCMODE
51 - AR6000_XIOCTL_WMI_SET_WMM
52 - AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS
53 - AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP
54 - AR6000_XIOCTL_WMI_GET_RD
55 - AR6000_XIOCTL_DIAG_READ
56 - AR6000_XIOCTL_DIAG_WRITE
57 - AR6000_XIOCTL_WMI_SET_TXOP
58 - AR6000_XIOCTL_USER_SETKEYS
59 - AR6000_XIOCTL_WMI_SET_KEEPALIVE
60 - AR6000_XIOCTL_WMI_GET_KEEPALIVE
ROM Patching ioctls
61 - AR6000_XIOCTL_BMI_ROMPATCH_INSTALL
62 - AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL
63 - AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE
64 - AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE
More wireless stuff
65 - AR6000_XIOCTL_WMI_SET_APPIE
66 - AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER
67 - AR6000_XIOCTL_DBGLOG_CFG_MODULE
68 - AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS
69 - undefined
not sure why this happened
70 - AR6000_XIOCTL_WMI_SET_WSC_STATUS
Bluetooth commands
71 - AR6000_XIOCTL_WMI_SET_BT_STATUS
- ar6000_xioctl_set_bt_status_cmd()
72 - AR6000_XIOCTL_WMI_SET_BT_PARAMS
- ar6000_xioctl_set_bt_params_cmd()
more random stuff
73 - AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE
WoW ioctls
74 - AR6000_XIOCTL_WMI_SET_WOW_MODE
75 - AR6000_XIOCTL_WMI_GET_WOW_LIST
76 - AR6000_XIOCTL_WMI_ADD_WOW_PATTERN
77 - AR6000_XIOCTL_WMI_DEL_WOW_PATTERN
More commands
78 - AR6000_XIOCTL_TARGET_INFO
79 - AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE
80 - AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE
This ioctl is used to emulate traffic activity timeouts. Activity/inactivity will trigger the driver to re-balance credits.
81 - AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS
82 - AR6000_XIOCTL_WMI_SET_AKMP_PARAMS
This IOCTL sets any Authentication, Key Management and Protection related parameters. This is used along with the information set in Connect Command. Currently this enables Multiple PMKIDs to an AP.
83 - AR6000_XIOCTL_WMI_GET_PMKID_LIST
84 - AR6000_XIOCTL_WMI_SET_PMKID_LIST
This IOCTL is used to set a list of PMKIDs. This list of PMKIDs is used in the [Re]AssocReq Frame. This list is used only if the MultiPMKID option is enabled via the AR6000_XIOCTL_WMI_SET_AKMP_PARAMS IOCTL.
85 - AR6000_XIOCTL_WMI_SET_PARAMS
86 - AR6000_XIOCTL_WMI_SET_MCAST_FILTER
87 - AR6000_XIOCTL_WMI_DEL_MCAST_FILTER
88 - undefined
not sure why
89 - undefined
not sure why
90 - AR6000_XIOCTL_UNUSED90
Historical DSETPATCH support for INI patches
91 - AR6000_XIOCTL_BMI_LZ_STREAM_START
Support LZ-compressed firmware download
92 - AR6000_XIOCTL_BMI_LZ_DATA
93 - AR6000_XIOCTL_PROF_CFG
94 - AR6000_XIOCTL_PROF_ADDR_SET
95 - AR6000_XIOCTL_PROF_START
96 - AR6000_XIOCTL_PROF_STOP
97 - AR6000_XIOCTL_PROF_COUNT_GET
98 - AR6000_XIOCTL_WMI_ABORT_SCAN
AP mode
99 - AR6000_XIOCTL_AP_GET_STA_LIST
100 - AR6000_XIOCTL_AP_HIDDEN_SSID
101 - AR6000_XIOCTL_AP_SET_NUM_STA
102 - AR6000_XIOCTL_AP_SET_ACL_MAC
103 - AR6000_XIOCTL_AP_GET_ACL_LIST
104 - AR6000_XIOCTL_AP_COMMIT_CONFIG
105 - IEEE80211_IOCTL_GETWPAIE
106 - AR6000_XIOCTL_AP_CONN_INACT_TIME
107 - AR6000_XIOCTL_AP_PROT_SCAN_TIME
108 - AR6000_XIOCTL_AP_SET_COUNTRY
109 - AR6000_XIOCTL_AP_SET_DTIM
110 - AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT
111 - AR6000_XIOCTL_SET_IP
112 - AR6000_XIOCTL_AP_SET_ACL_POLICY
113 - AR6000_XIOCTL_AP_INTRA_BSS_COMM
114 - AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO
115 - AR6000_XIOCTL_MODULE_DEBUG_SET_MASK
116 - AR6000_XIOCTL_MODULE_DEBUG_GET_MASK
117 - AR6000_XIOCTL_DUMP_RCV_AGGR_STATS
118 - AR6000_XIOCTL_SET_HT_CAP
119 - AR6000_XIOCTL_SET_HT_OP
120 - AR6000_XIOCTL_AP_GET_STAT
121 - AR6000_XIOCTL_SET_TX_SELECT_RATES
122 - AR6000_XIOCTL_SETUP_AGGR
123 - AR6000_XIOCTL_ALLOW_AGGR
124 - AR6000_XIOCTL_AP_GET_HIDDEN_SSID
125 - AR6000_XIOCTL_AP_GET_COUNTRY
Huh?
126 - AR6000_XIOCTL_AP_GET_WMODE
127 - AR6000_XIOCTL_AP_GET_DTIM
128 - AR6000_XIOCTL_AP_GET_BINTVL
129 - AR6000_XIOCTL_AP_GET_RTS
130 - AR6000_XIOCTL_DELE_AGGR
131 - AR6000_XIOCTL_FETCH_TARGET_REGS
132 - AR6000_XIOCTL_HCI_CMD
133 - AR6000_XIOCTL_ACL_DATA
134 - AR6000_XIOCTL_WLAN_CONN_PRECEDENCE
135 - AR6000_XIOCTL_AP_SET_11BG_RATESET
136 - AR6000_XIOCTL_WMI_SET_AP_PS
137 - AR6000_XIOCTL_WMI_MCAST_FILTER
More BT coex
138 - AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT
See ar6000_xioctl_set_btcoex_fe_ant_cmd()
139 - AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV
See ar6000_xioctl_set_btcoex_colocated_bt_dev_cmd()
140 - AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG
See ar6000_xioctl_set_btcoex_btinquiry_page_config_cmd()
141 - AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG
See ar6000_xioctl_set_btcoex_sco_config_cmd()
142 - AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG
See ar6000_xioctl_set_btcoex_a2dp_config_cmd()
143 - AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG
See ar6000_xioctl_set_btcoex_aclcoex_config_cmd()
144 - AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG
See ar60000_xioctl_set_btcoex_debug_cmd()
145 - AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS
See ar6000_xioctl_set_btcoex_bt_operating_status_cmd()
146 - AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG
See ar6000_xioctl_get_btcoex_config_cmd()
147 - AR6000_XIOCTL_WMI_GET_BTCOEX_STATS
See ar6000_xioctl_get_btcoex_stats_cmd()
More random stuff on wireless
148 - AR6000_XIOCTL_WMI_SET_QOS_SUPP
149 - AR6000_XIOCTL_GET_WLAN_SLEEP_STATE
150 - AR6000_XIOCTL_SET_BT_HW_POWER_STATE
151 - AR6000_XIOCTL_GET_BT_HW_POWER_STATE
152 - AR6000_XIOCTL_ADD_AP_INTERFACE
153 - AR6000_XIOCTL_REMOVE_AP_INTERFACE
154 - AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM
155 - 160 undefined
not sure why
some last command
AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES 161
?
Android
Android needs to be changed to use standard APIs, see this Android changes section.
config cleanup
CONFIG_HOST_TCMD_SUPPORT
This requires some special firmware and will vary depending on the revision of the chipset.
AR6003_REV1_VERSION –> AR6003_REV1_TCMD_FIRMWARE_FILE
AR6003_REV2_VERSION –> AR6003_REV2_TCMD_FIRMWARE_FILE
It seems this does not actually affect the WMI API other firmware so why not just remove the ifdef and keep the code in place. The only use I see for the config option is that it enables a module parameter testmode which if set then it will load the test firmware. This can likely be kept for now, even for proper placement in the Linux kernel.
Random always set macros
This can be remove and the code that makes sense left in place.
ccflags-y += -DLINUX -DKERNEL_2_6 ccflags-y += -DTCMD ccflags-y += -DSEND_EVENT_TO_APP ccflags-y += -DUSER_KEYS ccflags-y += -DNO_SYNC_FLUSH ccflags-y += -DHTC_EP_STAT_PROFILING ccflags-y += -DATH_AR6K_11N_SUPPORT ccflags-y += -DWAPI_ENABLE ccflags-y += -DCHECKSUM_OFFLOAD ccflags-y += -DWLAN_HEADERS ccflags-y += -DINIT_MODE_DRV_ENABLED ccflags-y += -DBMIENABLE_SET ... #if WIRELESS_EXT < 18
AP Mode support using cfg80211
No one is working on this yet.
WiFi Direct
No one is working on this yet