aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2008-01-14 20:46:17 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:56 -0500
commit3058f02137359efb412975cf94a9fa7c25413387 (patch)
tree673e1c9a579dce85f09cae8af577af61f54d4ef6 /drivers/net/wireless/iwlwifi
parent87e4f7dfe56dbaa5470e047d991c077f8e479d21 (diff)
iwlwifi: document scan command
Document scan command. Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h143
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-commands.h147
2 files changed, 234 insertions, 56 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index 3cac2c8ccf60..0c80ed5d7ea6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -1020,6 +1020,10 @@ struct iwl3945_rate_scaling_cmd {
1020 1020
1021/* 1021/*
1022 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) 1022 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
1023 *
1024 * 3945 and 4965 support hardware handshake with Bluetooth device on
1025 * same platform. Bluetooth device alerts wireless device when it will Tx;
1026 * wireless device can delay or kill its own Tx to accomodate.
1023 */ 1027 */
1024struct iwl3945_bt_cmd { 1028struct iwl3945_bt_cmd {
1025 u8 flags; 1029 u8 flags;
@@ -1258,20 +1262,47 @@ struct iwl3945_ct_kill_config {
1258 * 1262 *
1259 *****************************************************************************/ 1263 *****************************************************************************/
1260 1264
1265/**
1266 * struct iwl3945_scan_channel - entry in REPLY_SCAN_CMD channel table
1267 *
1268 * One for each channel in the scan list.
1269 * Each channel can independently select:
1270 * 1) SSID for directed active scans
1271 * 2) Txpower setting (for rate specified within Tx command)
1272 * 3) How long to stay on-channel (behavior may be modified by quiet_time,
1273 * quiet_plcp_th, good_CRC_th)
1274 *
1275 * To avoid uCode errors, make sure the following are true (see comments
1276 * under struct iwl3945_scan_cmd about max_out_time and quiet_time):
1277 * 1) If using passive_dwell (i.e. passive_dwell != 0):
1278 * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
1279 * 2) quiet_time <= active_dwell
1280 * 3) If restricting off-channel time (i.e. max_out_time !=0):
1281 * passive_dwell < max_out_time
1282 * active_dwell < max_out_time
1283 */
1261struct iwl3945_scan_channel { 1284struct iwl3945_scan_channel {
1262 /* type is defined as: 1285 /*
1263 * 0:0 active (0 - passive) 1286 * type is defined as:
1264 * 1:4 SSID direct 1287 * 0:0 1 = active, 0 = passive
1265 * If 1 is set then corresponding SSID IE is transmitted in probe 1288 * 1:4 SSID direct bit map; if a bit is set, then corresponding
1289 * SSID IE is transmitted in probe request.
1266 * 5:7 reserved 1290 * 5:7 reserved
1267 */ 1291 */
1268 u8 type; 1292 u8 type;
1269 u8 channel; 1293 u8 channel; /* band is selected by iwl3945_scan_cmd "flags" field */
1270 struct iwl3945_tx_power tpc; 1294 struct iwl3945_tx_power tpc;
1271 __le16 active_dwell; 1295 __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */
1272 __le16 passive_dwell; 1296 __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
1273} __attribute__ ((packed)); 1297} __attribute__ ((packed));
1274 1298
1299/**
1300 * struct iwl3945_ssid_ie - directed scan network information element
1301 *
1302 * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field
1303 * in struct iwl3945_scan_channel; each channel may select different ssids from
1304 * among the 4 entries. SSID IEs get transmitted in reverse order of entry.
1305 */
1275struct iwl3945_ssid_ie { 1306struct iwl3945_ssid_ie {
1276 u8 id; 1307 u8 id;
1277 u8 len; 1308 u8 len;
@@ -1285,40 +1316,98 @@ struct iwl3945_ssid_ie {
1285 1316
1286/* 1317/*
1287 * REPLY_SCAN_CMD = 0x80 (command) 1318 * REPLY_SCAN_CMD = 0x80 (command)
1319 *
1320 * The hardware scan command is very powerful; the driver can set it up to
1321 * maintain (relatively) normal network traffic while doing a scan in the
1322 * background. The max_out_time and suspend_time control the ratio of how
1323 * long the device stays on an associated network channel ("service channel")
1324 * vs. how long it's away from the service channel, tuned to other channels
1325 * for scanning.
1326 *
1327 * max_out_time is the max time off-channel (in usec), and suspend_time
1328 * is how long (in "extended beacon" format) that the scan is "suspended"
1329 * after returning to the service channel. That is, suspend_time is the
1330 * time that we stay on the service channel, doing normal work, between
1331 * scan segments. The driver may set these parameters differently to support
1332 * scanning when associated vs. not associated, and light vs. heavy traffic
1333 * loads when associated.
1334 *
1335 * After receiving this command, the device's scan engine does the following;
1336 *
1337 * 1) Sends SCAN_START notification to driver
1338 * 2) Checks to see if it has time to do scan for one channel
1339 * 3) Sends NULL packet, with power-save (PS) bit set to 1,
1340 * to tell AP that we're going off-channel
1341 * 4) Tunes to first channel in scan list, does active or passive scan
1342 * 5) Sends SCAN_RESULT notification to driver
1343 * 6) Checks to see if it has time to do scan on *next* channel in list
1344 * 7) Repeats 4-6 until it no longer has time to scan the next channel
1345 * before max_out_time expires
1346 * 8) Returns to service channel
1347 * 9) Sends NULL packet with PS=0 to tell AP that we're back
1348 * 10) Stays on service channel until suspend_time expires
1349 * 11) Repeats entire process 2-10 until list is complete
1350 * 12) Sends SCAN_COMPLETE notification
1351 *
1352 * For fast, efficient scans, the scan command also has support for staying on
1353 * a channel for just a short time, if doing active scanning and getting no
1354 * responses to the transmitted probe request. This time is controlled by
1355 * quiet_time, and the number of received packets below which a channel is
1356 * considered "quiet" is controlled by quiet_plcp_threshold.
1357 *
1358 * For active scanning on channels that have regulatory restrictions against
1359 * blindly transmitting, the scan can listen before transmitting, to make sure
1360 * that there is already legitimate activity on the channel. If enough
1361 * packets are cleanly received on the channel (controlled by good_CRC_th,
1362 * typical value 1), the scan engine starts transmitting probe requests.
1363 *
1364 * Driver must use separate scan commands for 2.4 vs. 5 GHz bands.
1365 *
1366 * To avoid uCode errors, see timing restrictions described under
1367 * struct iwl3945_scan_channel.
1288 */ 1368 */
1289struct iwl3945_scan_cmd { 1369struct iwl3945_scan_cmd {
1290 __le16 len; 1370 __le16 len;
1291 u8 reserved0; 1371 u8 reserved0;
1292 u8 channel_count; 1372 u8 channel_count; /* # channels in channel list */
1293 __le16 quiet_time; /* dwell only this long on quiet chnl 1373 __le16 quiet_time; /* dwell only this # millisecs on quiet channel
1294 * (active scan) */ 1374 * (only for active scan) */
1295 __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ 1375 __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */
1296 __le16 good_CRC_th; /* passive -> active promotion threshold */ 1376 __le16 good_CRC_th; /* passive -> active promotion threshold */
1297 __le16 reserved1; 1377 __le16 reserved1;
1298 __le32 max_out_time; /* max usec to be out of associated (service) 1378 __le32 max_out_time; /* max usec to be away from associated (service)
1299 * chnl */ 1379 * channel */
1300 __le32 suspend_time; /* pause scan this long when returning to svc 1380 __le32 suspend_time; /* pause scan this long (in "extended beacon
1301 * chnl. 1381 * format") when returning to service channel:
1302 * 3945 -- 31:24 # beacons, 19:0 additional usec, 1382 * 3945; 31:24 # beacons, 19:0 additional usec,
1303 * 4965 -- 31:22 # beacons, 21:0 additional usec. 1383 * 4965; 31:22 # beacons, 21:0 additional usec.
1304 */ 1384 */
1305 __le32 flags; 1385 __le32 flags; /* RXON_FLG_* */
1306 __le32 filter_flags; 1386 __le32 filter_flags; /* RXON_FILTER_* */
1307 1387
1388 /* For active scans (set to all-0s for passive scans).
1389 * Does not include payload. Must specify Tx rate; no rate scaling. */
1308 struct iwl3945_tx_cmd tx_cmd; 1390 struct iwl3945_tx_cmd tx_cmd;
1391
1392 /* For directed active scans (set to all-0s otherwise) */
1309 struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX]; 1393 struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX];
1310 1394
1311 u8 data[0];
1312 /* 1395 /*
1313 * The channels start after the probe request payload and are of type: 1396 * Probe request frame, followed by channel list.
1397 *
1398 * Size of probe request frame is specified by byte count in tx_cmd.
1399 * Channel list follows immediately after probe request frame.
1400 * Number of channels in list is specified by channel_count.
1401 * Each channel in list is of type:
1314 * 1402 *
1315 * struct iwl3945_scan_channel channels[0]; 1403 * struct iwl3945_scan_channel channels[0];
1316 * 1404 *
1317 * NOTE: Only one band of channels can be scanned per pass. You 1405 * NOTE: Only one band of channels can be scanned per pass. You
1318 * can not mix 2.4GHz channels and 5.2GHz channels and must 1406 * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
1319 * request a scan multiple times (not concurrently) 1407 * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
1320 * 1408 * before requesting another scan.
1321 */ 1409 */
1410 u8 data[0];
1322} __attribute__ ((packed)); 1411} __attribute__ ((packed));
1323 1412
1324/* Can abort will notify by complete notification with abort status. */ 1413/* Can abort will notify by complete notification with abort status. */
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index 7988c752a669..9237f8b3bb88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -1615,6 +1615,10 @@ struct iwl4965_link_quality_cmd {
1615 1615
1616/* 1616/*
1617 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) 1617 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
1618 *
1619 * 3945 and 4965 support hardware handshake with Bluetooth device on
1620 * same platform. Bluetooth device alerts wireless device when it will Tx;
1621 * wireless device can delay or kill its own Tx to accomodate.
1618 */ 1622 */
1619struct iwl4965_bt_cmd { 1623struct iwl4965_bt_cmd {
1620 u8 flags; 1624 u8 flags;
@@ -1857,20 +1861,47 @@ struct iwl4965_ct_kill_config {
1857 * 1861 *
1858 *****************************************************************************/ 1862 *****************************************************************************/
1859 1863
1864/**
1865 * struct iwl4965_scan_channel - entry in REPLY_SCAN_CMD channel table
1866 *
1867 * One for each channel in the scan list.
1868 * Each channel can independently select:
1869 * 1) SSID for directed active scans
1870 * 2) Txpower setting (for rate specified within Tx command)
1871 * 3) How long to stay on-channel (behavior may be modified by quiet_time,
1872 * quiet_plcp_th, good_CRC_th)
1873 *
1874 * To avoid uCode errors, make sure the following are true (see comments
1875 * under struct iwl4965_scan_cmd about max_out_time and quiet_time):
1876 * 1) If using passive_dwell (i.e. passive_dwell != 0):
1877 * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
1878 * 2) quiet_time <= active_dwell
1879 * 3) If restricting off-channel time (i.e. max_out_time !=0):
1880 * passive_dwell < max_out_time
1881 * active_dwell < max_out_time
1882 */
1860struct iwl4965_scan_channel { 1883struct iwl4965_scan_channel {
1861 /* type is defined as: 1884 /*
1862 * 0:0 active (0 - passive) 1885 * type is defined as:
1863 * 1:4 SSID direct 1886 * 0:0 1 = active, 0 = passive
1864 * If 1 is set then corresponding SSID IE is transmitted in probe 1887 * 1:4 SSID direct bit map; if a bit is set, then corresponding
1888 * SSID IE is transmitted in probe request.
1865 * 5:7 reserved 1889 * 5:7 reserved
1866 */ 1890 */
1867 u8 type; 1891 u8 type;
1868 u8 channel; 1892 u8 channel; /* band is selected by iwl4965_scan_cmd "flags" field */
1869 struct iwl4965_tx_power tpc; 1893 struct iwl4965_tx_power tpc;
1870 __le16 active_dwell; 1894 __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */
1871 __le16 passive_dwell; 1895 __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
1872} __attribute__ ((packed)); 1896} __attribute__ ((packed));
1873 1897
1898/**
1899 * struct iwl4965_ssid_ie - directed scan network information element
1900 *
1901 * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field
1902 * in struct iwl4965_scan_channel; each channel may select different ssids from
1903 * among the 4 entries. SSID IEs get transmitted in reverse order of entry.
1904 */
1874struct iwl4965_ssid_ie { 1905struct iwl4965_ssid_ie {
1875 u8 id; 1906 u8 id;
1876 u8 len; 1907 u8 len;
@@ -1884,40 +1915,98 @@ struct iwl4965_ssid_ie {
1884 1915
1885/* 1916/*
1886 * REPLY_SCAN_CMD = 0x80 (command) 1917 * REPLY_SCAN_CMD = 0x80 (command)
1918 *
1919 * The hardware scan command is very powerful; the driver can set it up to
1920 * maintain (relatively) normal network traffic while doing a scan in the
1921 * background. The max_out_time and suspend_time control the ratio of how
1922 * long the device stays on an associated network channel ("service channel")
1923 * vs. how long it's away from the service channel, i.e. tuned to other channels
1924 * for scanning.
1925 *
1926 * max_out_time is the max time off-channel (in usec), and suspend_time
1927 * is how long (in "extended beacon" format) that the scan is "suspended"
1928 * after returning to the service channel. That is, suspend_time is the
1929 * time that we stay on the service channel, doing normal work, between
1930 * scan segments. The driver may set these parameters differently to support
1931 * scanning when associated vs. not associated, and light vs. heavy traffic
1932 * loads when associated.
1933 *
1934 * After receiving this command, the device's scan engine does the following;
1935 *
1936 * 1) Sends SCAN_START notification to driver
1937 * 2) Checks to see if it has time to do scan for one channel
1938 * 3) Sends NULL packet, with power-save (PS) bit set to 1,
1939 * to tell AP that we're going off-channel
1940 * 4) Tunes to first channel in scan list, does active or passive scan
1941 * 5) Sends SCAN_RESULT notification to driver
1942 * 6) Checks to see if it has time to do scan on *next* channel in list
1943 * 7) Repeats 4-6 until it no longer has time to scan the next channel
1944 * before max_out_time expires
1945 * 8) Returns to service channel
1946 * 9) Sends NULL packet with PS=0 to tell AP that we're back
1947 * 10) Stays on service channel until suspend_time expires
1948 * 11) Repeats entire process 2-10 until list is complete
1949 * 12) Sends SCAN_COMPLETE notification
1950 *
1951 * For fast, efficient scans, the scan command also has support for staying on
1952 * a channel for just a short time, if doing active scanning and getting no
1953 * responses to the transmitted probe request. This time is controlled by
1954 * quiet_time, and the number of received packets below which a channel is
1955 * considered "quiet" is controlled by quiet_plcp_threshold.
1956 *
1957 * For active scanning on channels that have regulatory restrictions against
1958 * blindly transmitting, the scan can listen before transmitting, to make sure
1959 * that there is already legitimate activity on the channel. If enough
1960 * packets are cleanly received on the channel (controlled by good_CRC_th,
1961 * typical value 1), the scan engine starts transmitting probe requests.
1962 *
1963 * Driver must use separate scan commands for 2.4 vs. 5 GHz bands.
1964 *
1965 * To avoid uCode errors, see timing restrictions described under
1966 * struct iwl4965_scan_channel.
1887 */ 1967 */
1888struct iwl4965_scan_cmd { 1968struct iwl4965_scan_cmd {
1889 __le16 len; 1969 __le16 len;
1890 u8 reserved0; 1970 u8 reserved0;
1891 u8 channel_count; 1971 u8 channel_count; /* # channels in channel list */
1892 __le16 quiet_time; /* dwell only this long on quiet chnl 1972 __le16 quiet_time; /* dwell only this # millisecs on quiet channel
1893 * (active scan) */ 1973 * (only for active scan) */
1894 __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ 1974 __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */
1895 __le16 good_CRC_th; /* passive -> active promotion threshold */ 1975 __le16 good_CRC_th; /* passive -> active promotion threshold */
1896 __le16 rx_chain; 1976 __le16 rx_chain; /* RXON_RX_CHAIN_* */
1897 __le32 max_out_time; /* max usec to be out of associated (service) 1977 __le32 max_out_time; /* max usec to be away from associated (service)
1898 * chnl */ 1978 * channel */
1899 __le32 suspend_time; /* pause scan this long when returning to svc 1979 __le32 suspend_time; /* pause scan this long (in "extended beacon
1900 * chnl. 1980 * format") when returning to service chnl:
1901 * 3945 -- 31:24 # beacons, 19:0 additional usec, 1981 * 3945; 31:24 # beacons, 19:0 additional usec,
1902 * 4965 -- 31:22 # beacons, 21:0 additional usec. 1982 * 4965; 31:22 # beacons, 21:0 additional usec.
1903 */ 1983 */
1904 __le32 flags; 1984 __le32 flags; /* RXON_FLG_* */
1905 __le32 filter_flags; 1985 __le32 filter_flags; /* RXON_FILTER_* */
1906 1986
1987 /* For active scans (set to all-0s for passive scans).
1988 * Does not include payload. Must specify Tx rate; no rate scaling. */
1907 struct iwl4965_tx_cmd tx_cmd; 1989 struct iwl4965_tx_cmd tx_cmd;
1990
1991 /* For directed active scans (set to all-0s otherwise) */
1908 struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX]; 1992 struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX];
1909 1993
1910 u8 data[0];
1911 /* 1994 /*
1912 * The channels start after the probe request payload and are of type: 1995 * Probe request frame, followed by channel list.
1996 *
1997 * Size of probe request frame is specified by byte count in tx_cmd.
1998 * Channel list follows immediately after probe request frame.
1999 * Number of channels in list is specified by channel_count.
2000 * Each channel in list is of type:
1913 * 2001 *
1914 * struct iwl4965_scan_channel channels[0]; 2002 * struct iwl4965_scan_channel channels[0];
1915 * 2003 *
1916 * NOTE: Only one band of channels can be scanned per pass. You 2004 * NOTE: Only one band of channels can be scanned per pass. You
1917 * can not mix 2.4GHz channels and 5.2GHz channels and must 2005 * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
1918 * request a scan multiple times (not concurrently) 2006 * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
1919 * 2007 * before requesting another scan.
1920 */ 2008 */
2009 u8 data[0];
1921} __attribute__ ((packed)); 2010} __attribute__ ((packed));
1922 2011
1923/* Can abort will notify by complete notification with abort status. */ 2012/* Can abort will notify by complete notification with abort status. */
@@ -2087,7 +2176,7 @@ struct statistics_rx_non_phy {
2087 __le32 interference_data_flag; /* flag for interference data 2176 __le32 interference_data_flag; /* flag for interference data
2088 * availability. 1 when data is 2177 * availability. 1 when data is
2089 * available. */ 2178 * available. */
2090 __le32 channel_load; /* counts RX Enable time */ 2179 __le32 channel_load; /* counts RX Enable time in uSec */
2091 __le32 dsp_false_alarms; /* DSP false alarm (both OFDM 2180 __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
2092 * and CCK) counter */ 2181 * and CCK) counter */
2093 __le32 beacon_rssi_a; 2182 __le32 beacon_rssi_a;