aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/common.h')
-rw-r--r--drivers/net/wireless/iwlegacy/common.h234
1 files changed, 78 insertions, 156 deletions
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index abfa388588be..708095644f17 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -143,12 +143,6 @@ struct il_queue {
143 * space less than this */ 143 * space less than this */
144}; 144};
145 145
146/* One for each TFD */
147struct il_tx_info {
148 struct sk_buff *skb;
149 struct il_rxon_context *ctx;
150};
151
152/** 146/**
153 * struct il_tx_queue - Tx Queue for DMA 147 * struct il_tx_queue - Tx Queue for DMA
154 * @q: generic Rx/Tx queue descriptor 148 * @q: generic Rx/Tx queue descriptor
@@ -156,7 +150,7 @@ struct il_tx_info {
156 * @cmd: array of command/TX buffer pointers 150 * @cmd: array of command/TX buffer pointers
157 * @meta: array of meta data for each command/tx buffer 151 * @meta: array of meta data for each command/tx buffer
158 * @dma_addr_cmd: physical address of cmd/tx buffer array 152 * @dma_addr_cmd: physical address of cmd/tx buffer array
159 * @txb: array of per-TFD driver data 153 * @skbs: array of per-TFD socket buffer pointers
160 * @time_stamp: time (in jiffies) of last read_ptr change 154 * @time_stamp: time (in jiffies) of last read_ptr change
161 * @need_update: indicates need to update read/write idx 155 * @need_update: indicates need to update read/write idx
162 * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled 156 * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled
@@ -172,7 +166,7 @@ struct il_tx_queue {
172 void *tfds; 166 void *tfds;
173 struct il_device_cmd **cmd; 167 struct il_device_cmd **cmd;
174 struct il_cmd_meta *meta; 168 struct il_cmd_meta *meta;
175 struct il_tx_info *txb; 169 struct sk_buff **skbs;
176 unsigned long time_stamp; 170 unsigned long time_stamp;
177 u8 need_update; 171 u8 need_update;
178 u8 sched_retry; 172 u8 sched_retry;
@@ -735,13 +729,12 @@ struct il_qos_info {
735struct il_station_entry { 729struct il_station_entry {
736 struct il_addsta_cmd sta; 730 struct il_addsta_cmd sta;
737 struct il_tid_data tid[MAX_TID_COUNT]; 731 struct il_tid_data tid[MAX_TID_COUNT];
738 u8 used, ctxid; 732 u8 used;
739 struct il_hw_key keyinfo; 733 struct il_hw_key keyinfo;
740 struct il_link_quality_cmd *lq; 734 struct il_link_quality_cmd *lq;
741}; 735};
742 736
743struct il_station_priv_common { 737struct il_station_priv_common {
744 struct il_rxon_context *ctx;
745 u8 sta_id; 738 u8 sta_id;
746}; 739};
747 740
@@ -752,7 +745,6 @@ struct il_station_priv_common {
752 * space for us to put data into. 745 * space for us to put data into.
753 */ 746 */
754struct il_vif_priv { 747struct il_vif_priv {
755 struct il_rxon_context *ctx;
756 u8 ibss_bssid_sta_id; 748 u8 ibss_bssid_sta_id;
757}; 749};
758 750
@@ -816,6 +808,7 @@ struct il_sensitivity_ranges {
816 808
817/** 809/**
818 * struct il_hw_params 810 * struct il_hw_params
811 * @bcast_id: f/w broadcast station ID
819 * @max_txq_num: Max # Tx queues supported 812 * @max_txq_num: Max # Tx queues supported
820 * @dma_chnl_num: Number of Tx DMA/FIFO channels 813 * @dma_chnl_num: Number of Tx DMA/FIFO channels
821 * @scd_bc_tbls_size: size of scheduler byte count tables 814 * @scd_bc_tbls_size: size of scheduler byte count tables
@@ -836,6 +829,7 @@ struct il_sensitivity_ranges {
836 * @struct il_sensitivity_ranges: range of sensitivity values 829 * @struct il_sensitivity_ranges: range of sensitivity values
837 */ 830 */
838struct il_hw_params { 831struct il_hw_params {
832 u8 bcast_id;
839 u8 max_txq_num; 833 u8 max_txq_num;
840 u8 dma_chnl_num; 834 u8 dma_chnl_num;
841 u16 scd_bc_tbls_size; 835 u16 scd_bc_tbls_size;
@@ -1152,55 +1146,6 @@ struct il_force_reset {
1152 1146
1153struct il_rxon_context { 1147struct il_rxon_context {
1154 struct ieee80211_vif *vif; 1148 struct ieee80211_vif *vif;
1155
1156 const u8 *ac_to_fifo;
1157 const u8 *ac_to_queue;
1158 u8 mcast_queue;
1159
1160 /*
1161 * We could use the vif to indicate active, but we
1162 * also need it to be active during disabling when
1163 * we already removed the vif for type setting.
1164 */
1165 bool always_active, is_active;
1166
1167 bool ht_need_multiple_chains;
1168
1169 int ctxid;
1170
1171 u32 interface_modes, exclusive_interface_modes;
1172 u8 unused_devtype, ap_devtype, ibss_devtype, station_devtype;
1173
1174 /*
1175 * We declare this const so it can only be
1176 * changed via explicit cast within the
1177 * routines that actually update the physical
1178 * hardware.
1179 */
1180 const struct il_rxon_cmd active;
1181 struct il_rxon_cmd staging;
1182
1183 struct il_rxon_time_cmd timing;
1184
1185 struct il_qos_info qos_data;
1186
1187 u8 bcast_sta_id, ap_sta_id;
1188
1189 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
1190 u8 qos_cmd;
1191 u8 wep_key_cmd;
1192
1193 struct il_wep_key wep_keys[WEP_KEYS_MAX];
1194 u8 key_mapping_keys;
1195
1196 __le32 station_flags;
1197
1198 struct {
1199 bool non_gf_sta_present;
1200 u8 protection;
1201 bool enabled, is_40mhz;
1202 u8 extension_chan_offset;
1203 } ht;
1204}; 1149};
1205 1150
1206struct il_power_mgr { 1151struct il_power_mgr {
@@ -1217,6 +1162,7 @@ struct il_priv {
1217 struct ieee80211_channel *ieee_channels; 1162 struct ieee80211_channel *ieee_channels;
1218 struct ieee80211_rate *ieee_rates; 1163 struct ieee80211_rate *ieee_rates;
1219 struct il_cfg *cfg; 1164 struct il_cfg *cfg;
1165 const struct il_ops *ops;
1220 1166
1221 /* temporary frame storage list */ 1167 /* temporary frame storage list */
1222 struct list_head free_frames; 1168 struct list_head free_frames;
@@ -1304,7 +1250,28 @@ struct il_priv {
1304 u8 ucode_write_complete; /* the image write is complete */ 1250 u8 ucode_write_complete; /* the image write is complete */
1305 char firmware_name[25]; 1251 char firmware_name[25];
1306 1252
1307 struct il_rxon_context ctx; 1253 struct ieee80211_vif *vif;
1254
1255 struct il_qos_info qos_data;
1256
1257 struct {
1258 bool enabled;
1259 bool is_40mhz;
1260 bool non_gf_sta_present;
1261 u8 protection;
1262 u8 extension_chan_offset;
1263 } ht;
1264
1265 /*
1266 * We declare this const so it can only be
1267 * changed via explicit cast within the
1268 * routines that actually update the physical
1269 * hardware.
1270 */
1271 const struct il_rxon_cmd active;
1272 struct il_rxon_cmd staging;
1273
1274 struct il_rxon_time_cmd timing;
1308 1275
1309 __le16 switch_channel; 1276 __le16 switch_channel;
1310 1277
@@ -1427,6 +1394,9 @@ struct il_priv {
1427 u8 phy_calib_chain_noise_reset_cmd; 1394 u8 phy_calib_chain_noise_reset_cmd;
1428 u8 phy_calib_chain_noise_gain_cmd; 1395 u8 phy_calib_chain_noise_gain_cmd;
1429 1396
1397 u8 key_mapping_keys;
1398 struct il_wep_key wep_keys[WEP_KEYS_MAX];
1399
1430 struct il_notif_stats stats; 1400 struct il_notif_stats stats;
1431#ifdef CONFIG_IWLEGACY_DEBUGFS 1401#ifdef CONFIG_IWLEGACY_DEBUGFS
1432 struct il_notif_stats accum_stats; 1402 struct il_notif_stats accum_stats;
@@ -1449,7 +1419,7 @@ struct il_priv {
1449 struct work_struct rx_replenish; 1419 struct work_struct rx_replenish;
1450 struct work_struct abort_scan; 1420 struct work_struct abort_scan;
1451 1421
1452 struct il_rxon_context *beacon_ctx; 1422 bool beacon_enabled;
1453 struct sk_buff *beacon_skb; 1423 struct sk_buff *beacon_skb;
1454 1424
1455 struct work_struct tx_flush; 1425 struct work_struct tx_flush;
@@ -1507,30 +1477,10 @@ il_txq_ctx_deactivate(struct il_priv *il, int txq_id)
1507 clear_bit(txq_id, &il->txq_ctx_active_msk); 1477 clear_bit(txq_id, &il->txq_ctx_active_msk);
1508} 1478}
1509 1479
1510static inline struct ieee80211_hdr *
1511il_tx_queue_get_hdr(struct il_priv *il, int txq_id, int idx)
1512{
1513 if (il->txq[txq_id].txb[idx].skb)
1514 return (struct ieee80211_hdr *)il->txq[txq_id].txb[idx].skb->
1515 data;
1516 return NULL;
1517}
1518
1519static inline struct il_rxon_context *
1520il_rxon_ctx_from_vif(struct ieee80211_vif *vif)
1521{
1522 struct il_vif_priv *vif_priv = (void *)vif->drv_priv;
1523
1524 return vif_priv->ctx;
1525}
1526
1527#define for_each_context(il, _ctx) \
1528 for (_ctx = &il->ctx; _ctx == &il->ctx; _ctx++)
1529
1530static inline int 1480static inline int
1531il_is_associated(struct il_priv *il) 1481il_is_associated(struct il_priv *il)
1532{ 1482{
1533 return (il->ctx.active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; 1483 return (il->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1534} 1484}
1535 1485
1536static inline int 1486static inline int
@@ -1540,12 +1490,6 @@ il_is_any_associated(struct il_priv *il)
1540} 1490}
1541 1491
1542static inline int 1492static inline int
1543il_is_associated_ctx(struct il_rxon_context *ctx)
1544{
1545 return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1546}
1547
1548static inline int
1549il_is_channel_valid(const struct il_channel_info *ch_info) 1493il_is_channel_valid(const struct il_channel_info *ch_info)
1550{ 1494{
1551 if (ch_info == NULL) 1495 if (ch_info == NULL)
@@ -1614,10 +1558,9 @@ il_free_pages(struct il_priv *il, unsigned long page)
1614#define IL_RX_BUF_SIZE_8K (8 * 1024) 1558#define IL_RX_BUF_SIZE_8K (8 * 1024)
1615 1559
1616struct il_hcmd_ops { 1560struct il_hcmd_ops {
1617 int (*rxon_assoc) (struct il_priv *il, struct il_rxon_context *ctx); 1561 int (*rxon_assoc) (struct il_priv *il);
1618 int (*commit_rxon) (struct il_priv *il, struct il_rxon_context *ctx); 1562 int (*commit_rxon) (struct il_priv *il);
1619 void (*set_rxon_chain) (struct il_priv *il, 1563 void (*set_rxon_chain) (struct il_priv *il);
1620 struct il_rxon_context *ctx);
1621}; 1564};
1622 1565
1623struct il_hcmd_utils_ops { 1566struct il_hcmd_utils_ops {
@@ -1649,8 +1592,6 @@ struct il_temp_ops {
1649}; 1592};
1650 1593
1651struct il_lib_ops { 1594struct il_lib_ops {
1652 /* set hw dependent parameters */
1653 int (*set_hw_params) (struct il_priv *il);
1654 /* Handling TX */ 1595 /* Handling TX */
1655 void (*txq_update_byte_cnt_tbl) (struct il_priv *il, 1596 void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
1656 struct il_tx_queue *txq, 1597 struct il_tx_queue *txq,
@@ -1712,7 +1653,6 @@ struct il_ops {
1712 const struct il_led_ops *led; 1653 const struct il_led_ops *led;
1713 const struct il_nic_ops *nic; 1654 const struct il_nic_ops *nic;
1714 const struct il_legacy_ops *legacy; 1655 const struct il_legacy_ops *legacy;
1715 const struct ieee80211_ops *ieee80211_ops;
1716}; 1656};
1717 1657
1718struct il_mod_params { 1658struct il_mod_params {
@@ -1739,21 +1679,6 @@ struct il_mod_params {
1739 * chain noise calibration operation 1679 * chain noise calibration operation
1740 */ 1680 */
1741struct il_base_params { 1681struct il_base_params {
1742 int eeprom_size;
1743 int num_of_queues; /* def: HW dependent */
1744 int num_of_ampdu_queues; /* def: HW dependent */
1745 /* for il_apm_init() */
1746 u32 pll_cfg_val;
1747 bool set_l0s;
1748 bool use_bsm;
1749
1750 u16 led_compensation;
1751 int chain_noise_num_beacons;
1752 unsigned int wd_timeout;
1753 bool temperature_kelvin;
1754 const bool ucode_tracing;
1755 const bool sensitivity_calib_by_driver;
1756 const bool chain_noise_calib_by_driver;
1757}; 1682};
1758 1683
1759#define IL_LED_SOLID 11 1684#define IL_LED_SOLID 11
@@ -1821,7 +1746,6 @@ struct il_cfg {
1821 unsigned int sku; 1746 unsigned int sku;
1822 u16 eeprom_ver; 1747 u16 eeprom_ver;
1823 u16 eeprom_calib_ver; 1748 u16 eeprom_calib_ver;
1824 const struct il_ops *ops;
1825 /* module based parameters which can be set from modprobe cmd */ 1749 /* module based parameters which can be set from modprobe cmd */
1826 const struct il_mod_params *mod_params; 1750 const struct il_mod_params *mod_params;
1827 /* params not likely to change within a device family */ 1751 /* params not likely to change within a device family */
@@ -1829,31 +1753,43 @@ struct il_cfg {
1829 /* params likely to change within a device family */ 1753 /* params likely to change within a device family */
1830 u8 scan_rx_antennas[IEEE80211_NUM_BANDS]; 1754 u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
1831 enum il_led_mode led_mode; 1755 enum il_led_mode led_mode;
1756
1757 int eeprom_size;
1758 int num_of_queues; /* def: HW dependent */
1759 int num_of_ampdu_queues; /* def: HW dependent */
1760 /* for il_apm_init() */
1761 u32 pll_cfg_val;
1762 bool set_l0s;
1763 bool use_bsm;
1764
1765 u16 led_compensation;
1766 int chain_noise_num_beacons;
1767 unsigned int wd_timeout;
1768 bool temperature_kelvin;
1769 const bool ucode_tracing;
1770 const bool sensitivity_calib_by_driver;
1771 const bool chain_noise_calib_by_driver;
1832}; 1772};
1833 1773
1834/*************************** 1774/***************************
1835 * L i b * 1775 * L i b *
1836 ***************************/ 1776 ***************************/
1837 1777
1838struct ieee80211_hw *il_alloc_all(struct il_cfg *cfg);
1839int il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1778int il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1840 u16 queue, const struct ieee80211_tx_queue_params *params); 1779 u16 queue, const struct ieee80211_tx_queue_params *params);
1841int il_mac_tx_last_beacon(struct ieee80211_hw *hw); 1780int il_mac_tx_last_beacon(struct ieee80211_hw *hw);
1842 1781
1843void il_set_rxon_hwcrypto(struct il_priv *il, struct il_rxon_context *ctx, 1782void il_set_rxon_hwcrypto(struct il_priv *il, int hw_decrypt);
1844 int hw_decrypt); 1783int il_check_rxon_cmd(struct il_priv *il);
1845int il_check_rxon_cmd(struct il_priv *il, struct il_rxon_context *ctx); 1784int il_full_rxon_required(struct il_priv *il);
1846int il_full_rxon_required(struct il_priv *il, struct il_rxon_context *ctx); 1785int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch);
1847int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch, 1786void il_set_flags_for_band(struct il_priv *il, enum ieee80211_band band,
1848 struct il_rxon_context *ctx); 1787 struct ieee80211_vif *vif);
1849void il_set_flags_for_band(struct il_priv *il, struct il_rxon_context *ctx,
1850 enum ieee80211_band band, struct ieee80211_vif *vif);
1851u8 il_get_single_channel_number(struct il_priv *il, enum ieee80211_band band); 1788u8 il_get_single_channel_number(struct il_priv *il, enum ieee80211_band band);
1852void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf); 1789void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf);
1853bool il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx, 1790bool il_is_ht40_tx_allowed(struct il_priv *il,
1854 struct ieee80211_sta_ht_cap *ht_cap); 1791 struct ieee80211_sta_ht_cap *ht_cap);
1855void il_connection_init_rx_config(struct il_priv *il, 1792void il_connection_init_rx_config(struct il_priv *il);
1856 struct il_rxon_context *ctx);
1857void il_set_rate(struct il_priv *il); 1793void il_set_rate(struct il_priv *il);
1858int il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr, 1794int il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr,
1859 u32 decrypt_res, struct ieee80211_rx_status *stats); 1795 u32 decrypt_res, struct ieee80211_rx_status *stats);
@@ -1956,7 +1892,7 @@ int il_set_tx_power(struct il_priv *il, s8 tx_power, bool force);
1956 * Rate 1892 * Rate
1957 ******************************************************************************/ 1893 ******************************************************************************/
1958 1894
1959u8 il_get_lowest_plcp(struct il_priv *il, struct il_rxon_context *ctx); 1895u8 il_get_lowest_plcp(struct il_priv *il);
1960 1896
1961/******************************************************************************* 1897/*******************************************************************************
1962 * Scanning 1898 * Scanning
@@ -2043,10 +1979,10 @@ extern const struct dev_pm_ops il_pm_ops;
2043******************************************************/ 1979******************************************************/
2044void il4965_dump_nic_error_log(struct il_priv *il); 1980void il4965_dump_nic_error_log(struct il_priv *il);
2045#ifdef CONFIG_IWLEGACY_DEBUG 1981#ifdef CONFIG_IWLEGACY_DEBUG
2046void il_print_rx_config_cmd(struct il_priv *il, struct il_rxon_context *ctx); 1982void il_print_rx_config_cmd(struct il_priv *il);
2047#else 1983#else
2048static inline void 1984static inline void
2049il_print_rx_config_cmd(struct il_priv *il, struct il_rxon_context *ctx) 1985il_print_rx_config_cmd(struct il_priv *il)
2050{ 1986{
2051} 1987}
2052#endif 1988#endif
@@ -2135,17 +2071,18 @@ extern int il_send_stats_request(struct il_priv *il, u8 flags, bool clear);
2135void il_apm_stop(struct il_priv *il); 2071void il_apm_stop(struct il_priv *il);
2136int il_apm_init(struct il_priv *il); 2072int il_apm_init(struct il_priv *il);
2137 2073
2138int il_send_rxon_timing(struct il_priv *il, struct il_rxon_context *ctx); 2074int il_send_rxon_timing(struct il_priv *il);
2075
2139static inline int 2076static inline int
2140il_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx) 2077il_send_rxon_assoc(struct il_priv *il)
2141{ 2078{
2142 return il->cfg->ops->hcmd->rxon_assoc(il, ctx); 2079 return il->ops->hcmd->rxon_assoc(il);
2143} 2080}
2144 2081
2145static inline int 2082static inline int
2146il_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) 2083il_commit_rxon(struct il_priv *il)
2147{ 2084{
2148 return il->cfg->ops->hcmd->commit_rxon(il, ctx); 2085 return il->ops->hcmd->commit_rxon(il);
2149} 2086}
2150 2087
2151static inline const struct ieee80211_supported_band * 2088static inline const struct ieee80211_supported_band *
@@ -2303,23 +2240,22 @@ il_clear_bits_prph(struct il_priv *il, u32 reg, u32 mask)
2303 (this is for the IBSS BSSID stations) */ 2240 (this is for the IBSS BSSID stations) */
2304#define IL_STA_BCAST BIT(4) /* this station is the special bcast station */ 2241#define IL_STA_BCAST BIT(4) /* this station is the special bcast station */
2305 2242
2306void il_restore_stations(struct il_priv *il, struct il_rxon_context *ctx); 2243void il_restore_stations(struct il_priv *il);
2307void il_clear_ucode_stations(struct il_priv *il, struct il_rxon_context *ctx); 2244void il_clear_ucode_stations(struct il_priv *il);
2308void il_dealloc_bcast_stations(struct il_priv *il); 2245void il_dealloc_bcast_stations(struct il_priv *il);
2309int il_get_free_ucode_key_idx(struct il_priv *il); 2246int il_get_free_ucode_key_idx(struct il_priv *il);
2310int il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags); 2247int il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags);
2311int il_add_station_common(struct il_priv *il, struct il_rxon_context *ctx, 2248int il_add_station_common(struct il_priv *il, const u8 *addr, bool is_ap,
2312 const u8 *addr, bool is_ap,
2313 struct ieee80211_sta *sta, u8 *sta_id_r); 2249 struct ieee80211_sta *sta, u8 *sta_id_r);
2314int il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr); 2250int il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr);
2315int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2251int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2316 struct ieee80211_sta *sta); 2252 struct ieee80211_sta *sta);
2317 2253
2318u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx, 2254u8 il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
2319 const u8 *addr, bool is_ap, struct ieee80211_sta *sta); 2255 struct ieee80211_sta *sta);
2320 2256
2321int il_send_lq_cmd(struct il_priv *il, struct il_rxon_context *ctx, 2257int il_send_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq,
2322 struct il_link_quality_cmd *lq, u8 flags, bool init); 2258 u8 flags, bool init);
2323 2259
2324/** 2260/**
2325 * il_clear_driver_stations - clear knowledge of all stations from driver 2261 * il_clear_driver_stations - clear knowledge of all stations from driver
@@ -2334,24 +2270,11 @@ static inline void
2334il_clear_driver_stations(struct il_priv *il) 2270il_clear_driver_stations(struct il_priv *il)
2335{ 2271{
2336 unsigned long flags; 2272 unsigned long flags;
2337 struct il_rxon_context *ctx = &il->ctx;
2338 2273
2339 spin_lock_irqsave(&il->sta_lock, flags); 2274 spin_lock_irqsave(&il->sta_lock, flags);
2340 memset(il->stations, 0, sizeof(il->stations)); 2275 memset(il->stations, 0, sizeof(il->stations));
2341 il->num_stations = 0; 2276 il->num_stations = 0;
2342
2343 il->ucode_key_table = 0; 2277 il->ucode_key_table = 0;
2344
2345 /*
2346 * Remove all key information that is not stored as part
2347 * of station information since mac80211 may not have had
2348 * a chance to remove all the keys. When device is
2349 * reconfigured by mac80211 after an error all keys will
2350 * be reconfigured.
2351 */
2352 memset(ctx->wep_keys, 0, sizeof(ctx->wep_keys));
2353 ctx->key_mapping_keys = 0;
2354
2355 spin_unlock_irqrestore(&il->sta_lock, flags); 2278 spin_unlock_irqrestore(&il->sta_lock, flags);
2356} 2279}
2357 2280
@@ -2376,13 +2299,12 @@ il_sta_id(struct ieee80211_sta *sta)
2376 * inline wraps that pattern. 2299 * inline wraps that pattern.
2377 */ 2300 */
2378static inline int 2301static inline int
2379il_sta_id_or_broadcast(struct il_priv *il, struct il_rxon_context *context, 2302il_sta_id_or_broadcast(struct il_priv *il, struct ieee80211_sta *sta)
2380 struct ieee80211_sta *sta)
2381{ 2303{
2382 int sta_id; 2304 int sta_id;
2383 2305
2384 if (!sta) 2306 if (!sta)
2385 return context->bcast_sta_id; 2307 return il->hw_params.bcast_id;
2386 2308
2387 sta_id = il_sta_id(sta); 2309 sta_id = il_sta_id(sta);
2388 2310