diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:26:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:26:39 -0500 |
commit | 8926574c4d0055ca4c4a02d1f6b2c249d01a0621 (patch) | |
tree | 0c02c3cfff77e868d605246204add4664503b2af /drivers/net/wireless/mwifiex | |
parent | c056b734e54e12f38f34a2583a4824e6cecc16c1 (diff) | |
parent | b0302aba812bcc39291cdab9ad7e37008f352a91 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/rtlwifi/rtl8192se/sw.c
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/11n_aggr.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cmdevt.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/decl.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/init.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_rx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_tx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/txrx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/util.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.h | 4 |
14 files changed, 67 insertions, 51 deletions
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index 079e5532e68..ea6832dc667 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c @@ -182,7 +182,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, skb_reserve(skb_aggr, headroom + sizeof(struct txpd)); tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr); - tx_info_aggr->bss_index = tx_info_src->bss_index; + tx_info_aggr->bss_type = tx_info_src->bss_type; + tx_info_aggr->bss_num = tx_info_src->bss_num; skb_aggr->priority = skb_src->priority; do { diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index c3b6c4652cd..6fef4925d13 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -79,7 +79,7 @@ static int mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool pairwise, const u8 *mac_addr) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); if (mwifiex_set_encode(priv, NULL, 0, key_index, 1)) { wiphy_err(wiphy, "deleting the crypto keys\n"); @@ -122,7 +122,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, bool enabled, int timeout) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); u32 ps_mode; if (timeout) @@ -143,7 +143,7 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool unicast, bool multicast) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); /* Return if WEP key not configured */ if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED) @@ -165,7 +165,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool pairwise, const u8 *mac_addr, struct key_params *params) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); if (mwifiex_set_encode(priv, params->key, params->key_len, key_index, 0)) { @@ -376,7 +376,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, struct ieee80211_channel *chan, enum nl80211_channel_type channel_type) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); if (priv->media_connected) { wiphy_err(wiphy, "This setting is valid only when station " @@ -557,6 +557,23 @@ mwifiex_dump_station_info(struct mwifiex_private *priv, /* bit rate is in 500 kb/s units. Convert it to 100kb/s units */ sinfo->txrate.legacy = rate.rate * 5; + if (priv->bss_mode == NL80211_IFTYPE_STATION) { + sinfo->filled |= STATION_INFO_BSS_PARAM; + sinfo->bss_param.flags = 0; + if (priv->curr_bss_params.bss_descriptor.cap_info_bitmap & + WLAN_CAPABILITY_SHORT_PREAMBLE) + sinfo->bss_param.flags |= + BSS_PARAM_FLAGS_SHORT_PREAMBLE; + if (priv->curr_bss_params.bss_descriptor.cap_info_bitmap & + WLAN_CAPABILITY_SHORT_SLOT_TIME) + sinfo->bss_param.flags |= + BSS_PARAM_FLAGS_SHORT_SLOT_TIME; + sinfo->bss_param.dtim_period = + priv->curr_bss_params.bss_descriptor.dtim_period; + sinfo->bss_param.beacon_interval = + priv->curr_bss_params.bss_descriptor.beacon_period; + } + return ret; } @@ -1004,7 +1021,7 @@ static int mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_ibss_params *params) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); int ret = 0; if (priv->bss_mode != NL80211_IFTYPE_ADHOC) { @@ -1042,7 +1059,7 @@ done: static int mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n", priv->cfg_bssid); @@ -1217,7 +1234,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; priv->bss_priority = 0; priv->bss_role = MWIFIEX_BSS_ROLE_STA; - priv->bss_index = 0; priv->bss_num = 0; break; @@ -1281,10 +1297,7 @@ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); */ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev) { - struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); - - if (!priv || !dev) - return 0; + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); #ifdef CONFIG_DEBUG_FS mwifiex_dev_debugfs_remove(priv); diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 6e0a3eaecf7..6623db69e15 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -391,7 +391,8 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter) if (skb) { rx_info = MWIFIEX_SKB_RXCB(skb); - rx_info->bss_index = priv->bss_index; + rx_info->bss_num = priv->bss_num; + rx_info->bss_type = priv->bss_type; } if (eventcause != EVENT_PS_SLEEP && eventcause != EVENT_PS_AWAKE) { diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h index ae17ce02a3d..3735c775495 100644 --- a/drivers/net/wireless/mwifiex/decl.h +++ b/drivers/net/wireless/mwifiex/decl.h @@ -102,7 +102,8 @@ struct mwifiex_wait_queue { }; struct mwifiex_rxinfo { - u8 bss_index; + u8 bss_num; + u8 bss_type; struct sk_buff *parent; u8 use_count; }; @@ -110,7 +111,8 @@ struct mwifiex_rxinfo { struct mwifiex_txinfo { u32 status_code; u8 flags; - u8 bss_index; + u8 bss_num; + u8 bss_type; }; enum mwifiex_wmm_ac_e { diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index e05b417a3fa..e13b6d99171 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -526,8 +526,9 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv) cur = &adapter->bss_prio_tbl[i].bss_prio_cur; lock = &adapter->bss_prio_tbl[i].bss_prio_lock; dev_dbg(adapter->dev, "info: delete BSS priority table," - " index = %d, i = %d, head = %p, cur = %p\n", - priv->bss_index, i, head, *cur); + " bss_type = %d, bss_num = %d, i = %d," + " head = %p, cur = %p\n", + priv->bss_type, priv->bss_num, i, head, *cur); if (*cur) { spin_lock_irqsave(lock, flags); if (list_empty(head)) { diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 84be196188c..80e44566bf6 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -424,8 +424,8 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) struct sk_buff *new_skb; struct mwifiex_txinfo *tx_info; - dev_dbg(priv->adapter->dev, "data: %lu BSS(%d): Data <= kernel\n", - jiffies, priv->bss_index); + dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n", + jiffies, priv->bss_type, priv->bss_num); if (priv->adapter->surprise_removed) { kfree_skb(skb); @@ -458,10 +458,11 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) } tx_info = MWIFIEX_SKB_TXCB(skb); - tx_info->bss_index = priv->bss_index; + tx_info->bss_num = priv->bss_num; + tx_info->bss_type = priv->bss_type; mwifiex_fill_buffer(skb); - mwifiex_wmm_add_buf_txqueue(priv->adapter, skb); + mwifiex_wmm_add_buf_txqueue(priv, skb); atomic_inc(&priv->adapter->tx_pending); if (atomic_read(&priv->adapter->tx_pending) >= MAX_TX_PENDING) { @@ -531,8 +532,8 @@ mwifiex_tx_timeout(struct net_device *dev) { struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); - dev_err(priv->adapter->dev, "%lu : Tx timeout, bss_index=%d\n", - jiffies, priv->bss_index); + dev_err(priv->adapter->dev, "%lu : Tx timeout, bss_type-num = %d-%d\n", + jiffies, priv->bss_type, priv->bss_num); mwifiex_set_trans_start(dev); priv->num_tx_timeout++; } @@ -605,18 +606,6 @@ int is_command_pending(struct mwifiex_adapter *adapter) } /* - * This function returns the correct private structure pointer based - * upon the BSS number. - */ -struct mwifiex_private * -mwifiex_bss_index_to_priv(struct mwifiex_adapter *adapter, u8 bss_index) -{ - if (!adapter || (bss_index >= adapter->priv_num)) - return NULL; - return adapter->priv[bss_index]; -} - -/* * This is the main work queue function. * * It handles the main process, which in turn handles the complete diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 3186aa437f4..3dc0f721c1d 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h @@ -249,6 +249,7 @@ struct mwifiex_bssdescriptor { u32 channel; u32 freq; u16 beacon_period; + u8 dtim_period; u8 erp_flags; u32 bss_mode; u8 supported_rates[MWIFIEX_SUPPORTED_RATES]; @@ -352,7 +353,6 @@ struct mwifiex_private; struct mwifiex_private { struct mwifiex_adapter *adapter; - u8 bss_index; u8 bss_type; u8 bss_role; u8 bss_priority; @@ -884,8 +884,6 @@ mwifiex_netdev_get_priv(struct net_device *dev) return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev)); } -struct mwifiex_private *mwifiex_bss_index_to_priv(struct mwifiex_adapter - *adapter, u8 bss_index); int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, u32 func_init_shutdown); int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8); diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 6396d3318ea..135208596af 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1086,6 +1086,7 @@ mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, struct ieee_types_vendor_specific *vendor_ie; const u8 wpa_oui[4] = { 0x00, 0x50, 0xf2, 0x01 }; const u8 wmm_oui[4] = { 0x00, 0x50, 0xf2, 0x02 }; + struct ieee80211_tim_ie *tim_ie; found_data_rate_ie = false; rate_size = 0; @@ -1258,6 +1259,11 @@ mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, sizeof(struct ieee_types_header) - bss_entry->beacon_buf); break; + case WLAN_EID_TIM: + tim_ie = (void *) (current_ptr + + sizeof(struct ieee_types_header)); + bss_entry->dtim_period = tim_ie->dtim_period; + break; default: break; } @@ -2001,7 +2007,7 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv) kfree(priv->curr_bcn_buf); priv->curr_bcn_buf = kmalloc(curr_bss->beacon_buf_size, - GFP_KERNEL); + GFP_ATOMIC); if (!priv->curr_bcn_buf) { dev_err(priv->adapter->dev, "failed to alloc curr_bcn_buf\n"); diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c index 5e1ef7e5da4..d7a5d7616f2 100644 --- a/drivers/net/wireless/mwifiex/sta_rx.c +++ b/drivers/net/wireless/mwifiex/sta_rx.c @@ -43,7 +43,8 @@ int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, { int ret; struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); - struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; + struct mwifiex_private *priv = mwifiex_get_priv_by_id(adapter, + rx_info->bss_num, rx_info->bss_type); struct rx_packet_hdr *rx_pkt_hdr; struct rxpd *local_rx_pd; int hdr_chop; @@ -124,7 +125,8 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, struct rx_packet_hdr *rx_pkt_hdr; u8 ta[ETH_ALEN]; u16 rx_pkt_type; - struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; + struct mwifiex_private *priv = mwifiex_get_priv_by_id(adapter, + rx_info->bss_num, rx_info->bss_type); if (!priv) return -1; diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c index d97facd70e8..94d31a94620 100644 --- a/drivers/net/wireless/mwifiex/sta_tx.c +++ b/drivers/net/wireless/mwifiex/sta_tx.c @@ -136,7 +136,8 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags) return -1; tx_info = MWIFIEX_SKB_TXCB(skb); - tx_info->bss_index = priv->bss_index; + tx_info->bss_num = priv->bss_num; + tx_info->bss_type = priv->bss_type; skb_reserve(skb, sizeof(struct txpd) + INTF_HEADER_LEN); skb_push(skb, sizeof(struct txpd)); diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index d9274a1b77a..9a6eacc9d6f 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c @@ -48,7 +48,8 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, if (!priv) priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); - rx_info->bss_index = priv->bss_index; + rx_info->bss_num = priv->bss_num; + rx_info->bss_type = priv->bss_type; return mwifiex_process_sta_rx_packet(adapter, skb); } @@ -130,7 +131,8 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, return 0; tx_info = MWIFIEX_SKB_TXCB(skb); - priv = mwifiex_bss_index_to_priv(adapter, tx_info->bss_index); + priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num, + tx_info->bss_type); if (!priv) goto done; diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index 06976f517f6..9c48f37069f 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c @@ -159,7 +159,8 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) return -1; rx_info = MWIFIEX_SKB_RXCB(skb); - priv = mwifiex_bss_index_to_priv(adapter, rx_info->bss_index); + priv = mwifiex_get_priv_by_id(adapter, rx_info->bss_num, + rx_info->bss_type); if (!priv) return -1; diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 6c239c3c824..75f79ef9f6c 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c @@ -599,11 +599,10 @@ mwifiex_is_ralist_valid(struct mwifiex_private *priv, * is queued at the list tail. */ void -mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter, +mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, struct sk_buff *skb) { - struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb); - struct mwifiex_private *priv = adapter->priv[tx_info->bss_index]; + struct mwifiex_adapter *adapter = priv->adapter; u32 tid; struct mwifiex_ra_list_tbl *ra_list; u8 ra[ETH_ALEN], tid_down; diff --git a/drivers/net/wireless/mwifiex/wmm.h b/drivers/net/wireless/mwifiex/wmm.h index fcea1f68792..ec839952d2e 100644 --- a/drivers/net/wireless/mwifiex/wmm.h +++ b/drivers/net/wireless/mwifiex/wmm.h @@ -80,8 +80,8 @@ mwifiex_wmm_is_ra_list_empty(struct list_head *ra_list_hhead) return true; } -void mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter, - struct sk_buff *skb); +void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, + struct sk_buff *skb); void mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra); int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter); |