From 1d18a835612ce1e128d12ef4cf8017e561754f5f Mon Sep 17 00:00:00 2001 From: Arek Lichwa Date: Wed, 26 Oct 2011 11:23:22 +0200 Subject: [PATCH] --- yaml --- r: 275677 b: refs/heads/master c: 4dff523a913197e3314c7b0d08734ab037709093 h: refs/heads/master i: 275675: 9b3e83a48e4a683d58cb7abc6edc1f25c41ace37 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/b43/xmit.c | 15 ++------------- trunk/drivers/net/wireless/b43/xmit.h | 16 +--------------- .../net/wireless/brcm80211/brcmsmac/dma.c | 5 ++--- trunk/drivers/net/wireless/mwifiex/scan.c | 3 +-- trunk/include/net/mac80211.h | 3 +-- trunk/net/bluetooth/hci_conn.c | 2 +- trunk/net/mac80211/mlme.c | 19 ------------------- trunk/net/mac80211/sta_info.c | 8 ++++---- trunk/net/wireless/nl80211.c | 9 ++------- trunk/net/wireless/scan.c | 13 +++++-------- 11 files changed, 20 insertions(+), 75 deletions(-) diff --git a/[refs] b/[refs] index 5ec89fc5ebbd..8f50019c7f81 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 24b9c373ab787ccacfa2c46736153708796f5cd6 +refs/heads/master: 4dff523a913197e3314c7b0d08734ab037709093 diff --git a/trunk/drivers/net/wireless/b43/xmit.c b/trunk/drivers/net/wireless/b43/xmit.c index 5f77cbe0b6aa..58ea0e5fabfd 100644 --- a/trunk/drivers/net/wireless/b43/xmit.c +++ b/trunk/drivers/net/wireless/b43/xmit.c @@ -175,7 +175,6 @@ void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp, } } -/* TODO: verify if needed for SSLPN or LCN */ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate) { const struct b43_phy *phy = &dev->phy; @@ -257,9 +256,6 @@ int b43_generate_txhdr(struct b43_wldev *dev, unsigned int plcp_fragment_len; u32 mac_ctl = 0; u16 phy_ctl = 0; - bool fill_phy_ctl1 = (phy->type == B43_PHYTYPE_LP || - phy->type == B43_PHYTYPE_N || - phy->type == B43_PHYTYPE_HT); u8 extra_ft = 0; struct ieee80211_rate *txrate; struct ieee80211_tx_rate *rates; @@ -535,7 +531,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, extra_ft |= B43_TXH_EFT_RTSFB_CCK; if (rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS && - fill_phy_ctl1) { + phy->type == B43_PHYTYPE_N) { txhdr->phy_ctl1_rts = cpu_to_le16( b43_generate_tx_phy_ctl1(dev, rts_rate)); txhdr->phy_ctl1_rts_fb = cpu_to_le16( @@ -556,7 +552,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, break; } - if (fill_phy_ctl1) { + if (phy->type == B43_PHYTYPE_N) { txhdr->phy_ctl1 = cpu_to_le16(b43_generate_tx_phy_ctl1(dev, rate)); txhdr->phy_ctl1_fb = @@ -740,14 +736,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) /* Link quality statistics */ switch (chanstat & B43_RX_CHAN_PHYTYPE) { - case B43_PHYTYPE_HT: - /* TODO: is max the right choice? */ - status.signal = max_t(__s8, - max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1), - rxhdr->phy_ht_power2); - break; case B43_PHYTYPE_N: - /* Broadcom has code for min and avg, but always uses max */ if (rxhdr->power0 == 16 || rxhdr->power0 == 32) status.signal = max(rxhdr->power1, rxhdr->power2); else diff --git a/trunk/drivers/net/wireless/b43/xmit.h b/trunk/drivers/net/wireless/b43/xmit.h index 98d90747836a..16c514d54afa 100644 --- a/trunk/drivers/net/wireless/b43/xmit.h +++ b/trunk/drivers/net/wireless/b43/xmit.h @@ -249,12 +249,6 @@ struct b43_rxhdr_fw4 { } __packed; } __packed; union { - /* HT-PHY */ - struct { - PAD_BYTES(1); - __s8 phy_ht_power0; - } __packed; - /* RSSI for N-PHYs */ struct { __s8 power2; @@ -263,15 +257,7 @@ struct b43_rxhdr_fw4 { __le16 phy_status2; /* PHY RX Status 2 */ } __packed; - union { - /* HT-PHY */ - struct { - __s8 phy_ht_power1; - __s8 phy_ht_power2; - } __packed; - - __le16 phy_status3; /* PHY RX Status 3 */ - } __packed; + __le16 phy_status3; /* PHY RX Status 3 */ union { /* Tested with 598.314, 644.1001 and 666.2 */ struct { diff --git a/trunk/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/trunk/drivers/net/wireless/brcm80211/brcmsmac/dma.c index 6ebec8f42846..b56a30297c26 100644 --- a/trunk/drivers/net/wireless/brcm80211/brcmsmac/dma.c +++ b/trunk/drivers/net/wireless/brcm80211/brcmsmac/dma.c @@ -358,14 +358,13 @@ static uint nrxdactive(struct dma_info *di, uint h, uint t) static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags) { - uint dmactrlflags; + uint dmactrlflags = di->dma.dmactrlflags; if (di == NULL) { - DMA_ERROR(("_dma_ctrlflags: NULL dma handle\n")); + DMA_ERROR(("%s: _dma_ctrlflags: NULL dma handle\n", di->name)); return 0; } - dmactrlflags = di->dma.dmactrlflags; dmactrlflags &= ~mask; dmactrlflags |= flags; diff --git a/trunk/drivers/net/wireless/mwifiex/scan.c b/trunk/drivers/net/wireless/mwifiex/scan.c index 8a3f9598ad33..dae8dbb24a03 100644 --- a/trunk/drivers/net/wireless/mwifiex/scan.c +++ b/trunk/drivers/net/wireless/mwifiex/scan.c @@ -1469,7 +1469,7 @@ mwifiex_update_curr_bss_params(struct mwifiex_private *priv, u8 *bssid, s32 rssi, const u8 *ie_buf, size_t ie_len, u16 beacon_period, u16 cap_info_bitmap, u8 band) { - struct mwifiex_bssdescriptor *bss_desc; + struct mwifiex_bssdescriptor *bss_desc = NULL; int ret; unsigned long flags; u8 *beacon_ie; @@ -1484,7 +1484,6 @@ mwifiex_update_curr_bss_params(struct mwifiex_private *priv, u8 *bssid, beacon_ie = kmemdup(ie_buf, ie_len, GFP_KERNEL); if (!beacon_ie) { - kfree(bss_desc); dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n"); return -ENOMEM; } diff --git a/trunk/include/net/mac80211.h b/trunk/include/net/mac80211.h index 72eddd1b410b..dc1123aa8181 100644 --- a/trunk/include/net/mac80211.h +++ b/trunk/include/net/mac80211.h @@ -3567,9 +3567,8 @@ rate_lowest_index(struct ieee80211_supported_band *sband, return i; /* warn when we cannot find a rate. */ - WARN_ON_ONCE(1); + WARN_ON(1); - /* and return 0 (the lowest index) */ return 0; } diff --git a/trunk/net/bluetooth/hci_conn.c b/trunk/net/bluetooth/hci_conn.c index c1c597e3e198..e0af7237cd92 100644 --- a/trunk/net/bluetooth/hci_conn.c +++ b/trunk/net/bluetooth/hci_conn.c @@ -673,7 +673,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) goto encrypt; auth: - if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) + if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) return 0; if (!hci_conn_auth(conn, sec_level, auth_type)) diff --git a/trunk/net/mac80211/mlme.c b/trunk/net/mac80211/mlme.c index d3b408cda08d..17258feaab9b 100644 --- a/trunk/net/mac80211/mlme.c +++ b/trunk/net/mac80211/mlme.c @@ -1485,7 +1485,6 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, int i, j, err; bool have_higher_than_11mbit = false; u16 ap_ht_cap_flags; - int min_rate = INT_MAX, min_rate_index = -1; /* AssocResp and ReassocResp have identical structure */ @@ -1552,10 +1551,6 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, rates |= BIT(j); if (is_basic) basic_rates |= BIT(j); - if (rate < min_rate) { - min_rate = rate; - min_rate_index = j; - } break; } } @@ -1573,25 +1568,11 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, rates |= BIT(j); if (is_basic) basic_rates |= BIT(j); - if (rate < min_rate) { - min_rate = rate; - min_rate_index = j; - } break; } } } - /* - * some buggy APs don't advertise basic_rates. use the lowest - * supported rate instead. - */ - if (unlikely(!basic_rates) && min_rate_index >= 0) { - printk(KERN_DEBUG "%s: No basic rates in AssocResp. " - "Using min supported rate instead.\n", sdata->name); - basic_rates = BIT(min_rate_index); - } - sta->sta.supp_rates[wk->chan->band] = rates; sdata->vif.bss_conf.basic_rates = basic_rates; diff --git a/trunk/net/mac80211/sta_info.c b/trunk/net/mac80211/sta_info.c index 8eaa746ec7a2..ce962d2c8782 100644 --- a/trunk/net/mac80211/sta_info.c +++ b/trunk/net/mac80211/sta_info.c @@ -1354,12 +1354,12 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta, * Use MoreData flag to indicate whether there are * more buffered frames for this STA */ - if (more_data || !skb_queue_empty(&frames)) - hdr->frame_control |= - cpu_to_le16(IEEE80211_FCTL_MOREDATA); - else + if (!more_data) hdr->frame_control &= cpu_to_le16(~IEEE80211_FCTL_MOREDATA); + else + hdr->frame_control |= + cpu_to_le16(IEEE80211_FCTL_MOREDATA); if (ieee80211_is_data_qos(hdr->frame_control) || ieee80211_is_qos_nullfunc(hdr->frame_control)) diff --git a/trunk/net/wireless/nl80211.c b/trunk/net/wireless/nl80211.c index b3a476fe8272..48260c2d092a 100644 --- a/trunk/net/wireless/nl80211.c +++ b/trunk/net/wireless/nl80211.c @@ -132,7 +132,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG }, - [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN }, + [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY, + .len = NL80211_HT_CAPABILITY_LEN }, [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 }, [NL80211_ATTR_IE] = { .type = NLA_BINARY, @@ -1252,12 +1253,6 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) goto bad_res; } - if (netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && - netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) { - result = -EINVAL; - goto bad_res; - } - nla_for_each_nested(nl_txq_params, info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS], rem_txq_params) { diff --git a/trunk/net/wireless/scan.c b/trunk/net/wireless/scan.c index dc23b31594e0..0fb142410404 100644 --- a/trunk/net/wireless/scan.c +++ b/trunk/net/wireless/scan.c @@ -259,20 +259,17 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2) { const u8 *ie1 = cfg80211_find_ie(num, ies1, len1); const u8 *ie2 = cfg80211_find_ie(num, ies2, len2); + int r; - /* equal if both missing */ if (!ie1 && !ie2) return 0; - /* sort missing IE before (left of) present IE */ - if (!ie1) + if (!ie1 || !ie2) return -1; - if (!ie2) - return 1; - /* sort by length first, then by contents */ - if (ie1[1] != ie2[1]) + r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); + if (r == 0 && ie1[1] != ie2[1]) return ie2[1] - ie1[1]; - return memcmp(ie1 + 2, ie2 + 2, ie1[1]); + return r; } static bool is_bss(struct cfg80211_bss *a,