aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2200.h')
-rw-r--r--drivers/net/wireless/ipw2200.h103
1 files changed, 47 insertions, 56 deletions
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index e65620a4d79e..4b9804900702 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 2
3 Copyright(c) 2003 - 2005 Intel Corporation. All rights reserved. 3 Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved.
4 4
5 This program is free software; you can redistribute it and/or modify it 5 This program is free software; you can redistribute it and/or modify it
6 under the terms of version 2 of the GNU General Public License as 6 under the terms of version 2 of the GNU General Public License as
@@ -33,6 +33,7 @@
33#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
34#include <linux/config.h> 34#include <linux/config.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/mutex.h>
36 37
37#include <linux/pci.h> 38#include <linux/pci.h>
38#include <linux/netdevice.h> 39#include <linux/netdevice.h>
@@ -46,6 +47,7 @@
46#include <linux/firmware.h> 47#include <linux/firmware.h>
47#include <linux/wireless.h> 48#include <linux/wireless.h>
48#include <linux/dma-mapping.h> 49#include <linux/dma-mapping.h>
50#include <linux/jiffies.h>
49#include <asm/io.h> 51#include <asm/io.h>
50 52
51#include <net/ieee80211.h> 53#include <net/ieee80211.h>
@@ -244,8 +246,10 @@ enum connection_manager_assoc_states {
244#define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31 246#define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31
245 247
246#define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1 248#define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
247#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 24 249#define IPW_MB_ROAMING_THRESHOLD_MIN 1
248#define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8 250#define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8
251#define IPW_MB_ROAMING_THRESHOLD_MAX 30
252#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 3*IPW_MB_ROAMING_THRESHOLD_DEFAULT
249#define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300 253#define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300
250 254
251#define MACADRR_BYTE_LEN 6 255#define MACADRR_BYTE_LEN 6
@@ -616,13 +620,16 @@ struct notif_tgi_tx_key {
616 u8 reserved; 620 u8 reserved;
617} __attribute__ ((packed)); 621} __attribute__ ((packed));
618 622
623#define SILENCE_OVER_THRESH (1)
624#define SILENCE_UNDER_THRESH (2)
625
619struct notif_link_deterioration { 626struct notif_link_deterioration {
620 struct ipw_cmd_stats stats; 627 struct ipw_cmd_stats stats;
621 u8 rate; 628 u8 rate;
622 u8 modulation; 629 u8 modulation;
623 struct rate_histogram histogram; 630 struct rate_histogram histogram;
624 u8 reserved1; 631 u8 silence_notification_type; /* SILENCE_OVER/UNDER_THRESH */
625 u16 reserved2; 632 u16 silence_count;
626} __attribute__ ((packed)); 633} __attribute__ ((packed));
627 634
628struct notif_association { 635struct notif_association {
@@ -780,7 +787,7 @@ struct ipw_sys_config {
780 u8 enable_cts_to_self; 787 u8 enable_cts_to_self;
781 u8 enable_multicast_filtering; 788 u8 enable_multicast_filtering;
782 u8 bt_coexist_collision_thr; 789 u8 bt_coexist_collision_thr;
783 u8 reserved2; 790 u8 silence_threshold;
784 u8 accept_all_mgmt_bcpr; 791 u8 accept_all_mgmt_bcpr;
785 u8 accept_all_mgtm_frames; 792 u8 accept_all_mgtm_frames;
786 u8 pass_noise_stats_to_host; 793 u8 pass_noise_stats_to_host;
@@ -852,7 +859,7 @@ struct ipw_scan_request_ext {
852 u16 dwell_time[IPW_SCAN_TYPES]; 859 u16 dwell_time[IPW_SCAN_TYPES];
853} __attribute__ ((packed)); 860} __attribute__ ((packed));
854 861
855extern inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index) 862static inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index)
856{ 863{
857 if (index % 2) 864 if (index % 2)
858 return scan->scan_type[index / 2] & 0x0F; 865 return scan->scan_type[index / 2] & 0x0F;
@@ -860,7 +867,7 @@ extern inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index)
860 return (scan->scan_type[index / 2] & 0xF0) >> 4; 867 return (scan->scan_type[index / 2] & 0xF0) >> 4;
861} 868}
862 869
863extern inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan, 870static inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan,
864 u8 index, u8 scan_type) 871 u8 index, u8 scan_type)
865{ 872{
866 if (index % 2) 873 if (index % 2)
@@ -1120,7 +1127,7 @@ struct ipw_priv {
1120 struct ieee80211_device *ieee; 1127 struct ieee80211_device *ieee;
1121 1128
1122 spinlock_t lock; 1129 spinlock_t lock;
1123 struct semaphore sem; 1130 struct mutex mutex;
1124 1131
1125 /* basic pci-network driver stuff */ 1132 /* basic pci-network driver stuff */
1126 struct pci_dev *pci_dev; 1133 struct pci_dev *pci_dev;
@@ -1406,13 +1413,6 @@ do { if (ipw_debug_level & (level)) \
1406* Register bit definitions 1413* Register bit definitions
1407*/ 1414*/
1408 1415
1409/* Dino control registers bits */
1410
1411#define DINO_ENABLE_SYSTEM 0x80
1412#define DINO_ENABLE_CS 0x40
1413#define DINO_RXFIFO_DATA 0x01
1414#define DINO_CONTROL_REG 0x00200000
1415
1416#define IPW_INTA_RW 0x00000008 1416#define IPW_INTA_RW 0x00000008
1417#define IPW_INTA_MASK_R 0x0000000C 1417#define IPW_INTA_MASK_R 0x0000000C
1418#define IPW_INDIRECT_ADDR 0x00000010 1418#define IPW_INDIRECT_ADDR 0x00000010
@@ -1459,6 +1459,11 @@ do { if (ipw_debug_level & (level)) \
1459#define IPW_DOMAIN_0_END 0x1000 1459#define IPW_DOMAIN_0_END 0x1000
1460#define CLX_MEM_BAR_SIZE 0x1000 1460#define CLX_MEM_BAR_SIZE 0x1000
1461 1461
1462/* Dino/baseband control registers bits */
1463
1464#define DINO_ENABLE_SYSTEM 0x80 /* 1 = baseband processor on, 0 = reset */
1465#define DINO_ENABLE_CS 0x40 /* 1 = enable ucode load */
1466#define DINO_RXFIFO_DATA 0x01 /* 1 = data available */
1462#define IPW_BASEBAND_CONTROL_STATUS 0X00200000 1467#define IPW_BASEBAND_CONTROL_STATUS 0X00200000
1463#define IPW_BASEBAND_TX_FIFO_WRITE 0X00200004 1468#define IPW_BASEBAND_TX_FIFO_WRITE 0X00200004
1464#define IPW_BASEBAND_RX_FIFO_READ 0X00200004 1469#define IPW_BASEBAND_RX_FIFO_READ 0X00200004
@@ -1567,13 +1572,18 @@ do { if (ipw_debug_level & (level)) \
1567#define EEPROM_BSS_CHANNELS_BG (GET_EEPROM_ADDR(0x2c,LSB)) /* 2 bytes */ 1572#define EEPROM_BSS_CHANNELS_BG (GET_EEPROM_ADDR(0x2c,LSB)) /* 2 bytes */
1568#define EEPROM_HW_VERSION (GET_EEPROM_ADDR(0x72,LSB)) /* 2 bytes */ 1573#define EEPROM_HW_VERSION (GET_EEPROM_ADDR(0x72,LSB)) /* 2 bytes */
1569 1574
1570/* NIC type as found in the one byte EEPROM_NIC_TYPE offset*/ 1575/* NIC type as found in the one byte EEPROM_NIC_TYPE offset */
1571#define EEPROM_NIC_TYPE_0 0 1576#define EEPROM_NIC_TYPE_0 0
1572#define EEPROM_NIC_TYPE_1 1 1577#define EEPROM_NIC_TYPE_1 1
1573#define EEPROM_NIC_TYPE_2 2 1578#define EEPROM_NIC_TYPE_2 2
1574#define EEPROM_NIC_TYPE_3 3 1579#define EEPROM_NIC_TYPE_3 3
1575#define EEPROM_NIC_TYPE_4 4 1580#define EEPROM_NIC_TYPE_4 4
1576 1581
1582/* Bluetooth Coexistence capabilities as found in EEPROM_SKU_CAPABILITY */
1583#define EEPROM_SKU_CAP_BT_CHANNEL_SIG 0x01 /* we can tell BT our channel # */
1584#define EEPROM_SKU_CAP_BT_PRIORITY 0x02 /* BT can take priority over us */
1585#define EEPROM_SKU_CAP_BT_OOB 0x04 /* we can signal BT out-of-band */
1586
1577#define FW_MEM_REG_LOWER_BOUND 0x00300000 1587#define FW_MEM_REG_LOWER_BOUND 0x00300000
1578#define FW_MEM_REG_EEPROM_ACCESS (FW_MEM_REG_LOWER_BOUND + 0x40) 1588#define FW_MEM_REG_EEPROM_ACCESS (FW_MEM_REG_LOWER_BOUND + 0x40)
1579#define IPW_EVENT_REG (FW_MEM_REG_LOWER_BOUND + 0x04) 1589#define IPW_EVENT_REG (FW_MEM_REG_LOWER_BOUND + 0x04)
@@ -1658,9 +1668,10 @@ enum {
1658 IPW_FW_ERROR_FATAL_ERROR 1668 IPW_FW_ERROR_FATAL_ERROR
1659}; 1669};
1660 1670
1661#define AUTH_OPEN 0 1671#define AUTH_OPEN 0
1662#define AUTH_SHARED_KEY 1 1672#define AUTH_SHARED_KEY 1
1663#define AUTH_IGNORE 3 1673#define AUTH_LEAP 2
1674#define AUTH_IGNORE 3
1664 1675
1665#define HC_ASSOCIATE 0 1676#define HC_ASSOCIATE 0
1666#define HC_REASSOCIATE 1 1677#define HC_REASSOCIATE 1
@@ -1860,7 +1871,7 @@ struct host_cmd {
1860 u8 cmd; 1871 u8 cmd;
1861 u8 len; 1872 u8 len;
1862 u16 reserved; 1873 u16 reserved;
1863 u32 param[TFD_CMD_IMMEDIATE_PAYLOAD_LENGTH]; 1874 u32 *param;
1864} __attribute__ ((packed)); 1875} __attribute__ ((packed));
1865 1876
1866struct ipw_cmd_log { 1877struct ipw_cmd_log {
@@ -1869,21 +1880,24 @@ struct ipw_cmd_log {
1869 struct host_cmd cmd; 1880 struct host_cmd cmd;
1870}; 1881};
1871 1882
1872#define CFG_BT_COEXISTENCE_MIN 0x00 1883/* SysConfig command parameters ... */
1873#define CFG_BT_COEXISTENCE_DEFER 0x02 1884/* bt_coexistence param */
1874#define CFG_BT_COEXISTENCE_KILL 0x04 1885#define CFG_BT_COEXISTENCE_SIGNAL_CHNL 0x01 /* tell BT our chnl # */
1875#define CFG_BT_COEXISTENCE_WME_OVER_BT 0x08 1886#define CFG_BT_COEXISTENCE_DEFER 0x02 /* defer our Tx if BT traffic */
1876#define CFG_BT_COEXISTENCE_OOB 0x10 1887#define CFG_BT_COEXISTENCE_KILL 0x04 /* kill our Tx if BT traffic */
1877#define CFG_BT_COEXISTENCE_MAX 0xFF 1888#define CFG_BT_COEXISTENCE_WME_OVER_BT 0x08 /* multimedia extensions */
1878#define CFG_BT_COEXISTENCE_DEF 0x80 /* read Bt from EEPROM */ 1889#define CFG_BT_COEXISTENCE_OOB 0x10 /* signal BT via out-of-band */
1879 1890
1880#define CFG_CTS_TO_ITSELF_ENABLED_MIN 0x0 1891/* clear-to-send to self param */
1881#define CFG_CTS_TO_ITSELF_ENABLED_MAX 0x1 1892#define CFG_CTS_TO_ITSELF_ENABLED_MIN 0x00
1893#define CFG_CTS_TO_ITSELF_ENABLED_MAX 0x01
1882#define CFG_CTS_TO_ITSELF_ENABLED_DEF CFG_CTS_TO_ITSELF_ENABLED_MIN 1894#define CFG_CTS_TO_ITSELF_ENABLED_DEF CFG_CTS_TO_ITSELF_ENABLED_MIN
1883 1895
1884#define CFG_SYS_ANTENNA_BOTH 0x000 1896/* Antenna diversity param (h/w can select best antenna, based on signal) */
1885#define CFG_SYS_ANTENNA_A 0x001 1897#define CFG_SYS_ANTENNA_BOTH 0x00 /* NIC selects best antenna */
1886#define CFG_SYS_ANTENNA_B 0x003 1898#define CFG_SYS_ANTENNA_A 0x01 /* force antenna A */
1899#define CFG_SYS_ANTENNA_B 0x03 /* force antenna B */
1900#define CFG_SYS_ANTENNA_SLOW_DIV 0x02 /* consider background noise */
1887 1901
1888/* 1902/*
1889 * The definitions below were lifted off the ipw2100 driver, which only 1903 * The definitions below were lifted off the ipw2100 driver, which only
@@ -1899,27 +1913,4 @@ struct ipw_cmd_log {
1899 1913
1900#define IPW_MAX_CONFIG_RETRIES 10 1914#define IPW_MAX_CONFIG_RETRIES 10
1901 1915
1902static inline u32 frame_hdr_len(struct ieee80211_hdr_4addr *hdr)
1903{
1904 u32 retval;
1905 u16 fc;
1906
1907 retval = sizeof(struct ieee80211_hdr_3addr);
1908 fc = le16_to_cpu(hdr->frame_ctl);
1909
1910 /*
1911 * Function ToDS FromDS
1912 * IBSS 0 0
1913 * To AP 1 0
1914 * From AP 0 1
1915 * WDS (bridge) 1 1
1916 *
1917 * Only WDS frames use Address4 among them. --YZ
1918 */
1919 if (!(fc & IEEE80211_FCTL_TODS) || !(fc & IEEE80211_FCTL_FROMDS))
1920 retval -= ETH_ALEN;
1921
1922 return retval;
1923}
1924
1925#endif /* __ipw2200_h__ */ 1916#endif /* __ipw2200_h__ */