Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

+95 -29
+3
drivers/bluetooth/btusb.c
··· 100 100 /* Canyon CN-BTU1 with HID interfaces */ 101 101 { USB_DEVICE(0x0c10, 0x0000) }, 102 102 103 + /* Broadcom BCM20702A0 */ 104 + { USB_DEVICE(0x413c, 0x8197) }, 105 + 103 106 { } /* Terminating entry */ 104 107 }; 105 108
+2
drivers/net/wireless/ath/regd.c
··· 254 254 int r; 255 255 256 256 sband = wiphy->bands[IEEE80211_BAND_2GHZ]; 257 + if (!sband) 258 + return; 257 259 258 260 /* 259 261 * If no country IE has been received always enable active scan
+13 -2
drivers/net/wireless/b43/xmit.c
··· 175 175 } 176 176 } 177 177 178 + /* TODO: verify if needed for SSLPN or LCN */ 178 179 static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate) 179 180 { 180 181 const struct b43_phy *phy = &dev->phy; ··· 257 256 unsigned int plcp_fragment_len; 258 257 u32 mac_ctl = 0; 259 258 u16 phy_ctl = 0; 259 + bool fill_phy_ctl1 = (phy->type == B43_PHYTYPE_LP || 260 + phy->type == B43_PHYTYPE_N || 261 + phy->type == B43_PHYTYPE_HT); 260 262 u8 extra_ft = 0; 261 263 struct ieee80211_rate *txrate; 262 264 struct ieee80211_tx_rate *rates; ··· 535 531 extra_ft |= B43_TXH_EFT_RTSFB_CCK; 536 532 537 533 if (rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS && 538 - phy->type == B43_PHYTYPE_N) { 534 + fill_phy_ctl1) { 539 535 txhdr->phy_ctl1_rts = cpu_to_le16( 540 536 b43_generate_tx_phy_ctl1(dev, rts_rate)); 541 537 txhdr->phy_ctl1_rts_fb = cpu_to_le16( ··· 556 552 break; 557 553 } 558 554 559 - if (phy->type == B43_PHYTYPE_N) { 555 + if (fill_phy_ctl1) { 560 556 txhdr->phy_ctl1 = 561 557 cpu_to_le16(b43_generate_tx_phy_ctl1(dev, rate)); 562 558 txhdr->phy_ctl1_fb = ··· 740 736 741 737 /* Link quality statistics */ 742 738 switch (chanstat & B43_RX_CHAN_PHYTYPE) { 739 + case B43_PHYTYPE_HT: 740 + /* TODO: is max the right choice? */ 741 + status.signal = max_t(__s8, 742 + max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1), 743 + rxhdr->phy_ht_power2); 744 + break; 743 745 case B43_PHYTYPE_N: 746 + /* Broadcom has code for min and avg, but always uses max */ 744 747 if (rxhdr->power0 == 16 || rxhdr->power0 == 32) 745 748 status.signal = max(rxhdr->power1, rxhdr->power2); 746 749 else
+15 -1
drivers/net/wireless/b43/xmit.h
··· 249 249 } __packed; 250 250 } __packed; 251 251 union { 252 + /* HT-PHY */ 253 + struct { 254 + PAD_BYTES(1); 255 + __s8 phy_ht_power0; 256 + } __packed; 257 + 252 258 /* RSSI for N-PHYs */ 253 259 struct { 254 260 __s8 power2; ··· 263 257 264 258 __le16 phy_status2; /* PHY RX Status 2 */ 265 259 } __packed; 266 - __le16 phy_status3; /* PHY RX Status 3 */ 260 + union { 261 + /* HT-PHY */ 262 + struct { 263 + __s8 phy_ht_power1; 264 + __s8 phy_ht_power2; 265 + } __packed; 266 + 267 + __le16 phy_status3; /* PHY RX Status 3 */ 268 + } __packed; 267 269 union { 268 270 /* Tested with 598.314, 644.1001 and 666.2 */ 269 271 struct {
+3 -2
drivers/net/wireless/brcm80211/brcmsmac/dma.c
··· 358 358 359 359 static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags) 360 360 { 361 - uint dmactrlflags = di->dma.dmactrlflags; 361 + uint dmactrlflags; 362 362 363 363 if (di == NULL) { 364 - DMA_ERROR(("%s: _dma_ctrlflags: NULL dma handle\n", di->name)); 364 + DMA_ERROR(("_dma_ctrlflags: NULL dma handle\n")); 365 365 return 0; 366 366 } 367 367 368 + dmactrlflags = di->dma.dmactrlflags; 368 369 dmactrlflags &= ~mask; 369 370 dmactrlflags |= flags; 370 371
+2 -1
drivers/net/wireless/mwifiex/scan.c
··· 1469 1469 s32 rssi, const u8 *ie_buf, size_t ie_len, 1470 1470 u16 beacon_period, u16 cap_info_bitmap, u8 band) 1471 1471 { 1472 - struct mwifiex_bssdescriptor *bss_desc = NULL; 1472 + struct mwifiex_bssdescriptor *bss_desc; 1473 1473 int ret; 1474 1474 unsigned long flags; 1475 1475 u8 *beacon_ie; ··· 1484 1484 1485 1485 beacon_ie = kmemdup(ie_buf, ie_len, GFP_KERNEL); 1486 1486 if (!beacon_ie) { 1487 + kfree(bss_desc); 1487 1488 dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n"); 1488 1489 return -ENOMEM; 1489 1490 }
+1 -1
drivers/net/wireless/wl12xx/scan.c
··· 559 559 break; 560 560 } 561 561 /* Fail if SSID isn't present in the filters */ 562 - if (j == req->n_ssids) { 562 + if (j == cmd->n_ssids) { 563 563 ret = -EINVAL; 564 564 goto out_free; 565 565 }
+5 -2
include/net/bluetooth/l2cap.h
··· 39 39 #define L2CAP_DEFAULT_ACK_TO 200 40 40 #define L2CAP_LE_DEFAULT_MTU 23 41 41 42 - #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 43 - #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 42 + #define L2CAP_DISC_TIMEOUT (100) 43 + #define L2CAP_DISC_REJ_TIMEOUT (5000) /* 5 seconds */ 44 + #define L2CAP_ENC_TIMEOUT (5000) /* 5 seconds */ 45 + #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 46 + #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 44 47 45 48 /* L2CAP socket address */ 46 49 struct sockaddr_l2 {
+4
include/net/cfg80211.h
··· 456 456 * as the AC bitmap in the QoS info field 457 457 * @max_sp: max Service Period. same format as the MAX_SP in the 458 458 * QoS info field (but already shifted down) 459 + * @sta_modify_mask: bitmap indicating which parameters changed 460 + * (for those that don't have a natural "no change" value), 461 + * see &enum station_parameters_apply_mask 459 462 */ 460 463 struct station_parameters { 461 464 u8 *supported_rates; ··· 618 615 * user space MLME/SME implementation. The information is provided for 619 616 * the cfg80211_new_sta() calls to notify user space of the IEs. 620 617 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. 618 + * @sta_flags: station flags mask & values 621 619 */ 622 620 struct station_info { 623 621 u32 filled;
+1 -1
net/bluetooth/hci_conn.c
··· 673 673 goto encrypt; 674 674 675 675 auth: 676 - if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 676 + if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 677 677 return 0; 678 678 679 679 if (!hci_conn_auth(conn, sec_level, auth_type))
+8 -8
net/bluetooth/l2cap_core.c
··· 251 251 252 252 if (sock_owned_by_user(sk)) { 253 253 /* sk is owned by user. Try again later */ 254 - __set_chan_timer(chan, HZ / 5); 254 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 255 255 bh_unlock_sock(sk); 256 256 chan_put(chan); 257 257 return; ··· 2488 2488 if (sock_owned_by_user(sk)) { 2489 2489 l2cap_state_change(chan, BT_DISCONN); 2490 2490 __clear_chan_timer(chan); 2491 - __set_chan_timer(chan, HZ / 5); 2491 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 2492 2492 break; 2493 2493 } 2494 2494 ··· 2661 2661 2662 2662 default: 2663 2663 sk->sk_err = ECONNRESET; 2664 - __set_chan_timer(chan, HZ * 5); 2664 + __set_chan_timer(chan, L2CAP_DISC_REJ_TIMEOUT); 2665 2665 l2cap_send_disconn_req(conn, chan, ECONNRESET); 2666 2666 goto done; 2667 2667 } ··· 2718 2718 if (sock_owned_by_user(sk)) { 2719 2719 l2cap_state_change(chan, BT_DISCONN); 2720 2720 __clear_chan_timer(chan); 2721 - __set_chan_timer(chan, HZ / 5); 2721 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 2722 2722 bh_unlock_sock(sk); 2723 2723 return 0; 2724 2724 } ··· 2752 2752 if (sock_owned_by_user(sk)) { 2753 2753 l2cap_state_change(chan,BT_DISCONN); 2754 2754 __clear_chan_timer(chan); 2755 - __set_chan_timer(chan, HZ / 5); 2755 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 2756 2756 bh_unlock_sock(sk); 2757 2757 return 0; 2758 2758 } ··· 3998 3998 if (encrypt == 0x00) { 3999 3999 if (chan->sec_level == BT_SECURITY_MEDIUM) { 4000 4000 __clear_chan_timer(chan); 4001 - __set_chan_timer(chan, HZ * 5); 4001 + __set_chan_timer(chan, L2CAP_ENC_TIMEOUT); 4002 4002 } else if (chan->sec_level == BT_SECURITY_HIGH) 4003 4003 l2cap_chan_close(chan, ECONNREFUSED); 4004 4004 } else { ··· 4066 4066 L2CAP_CONN_REQ, sizeof(req), &req); 4067 4067 } else { 4068 4068 __clear_chan_timer(chan); 4069 - __set_chan_timer(chan, HZ / 10); 4069 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 4070 4070 } 4071 4071 } else if (chan->state == BT_CONNECT2) { 4072 4072 struct l2cap_conn_rsp rsp; ··· 4086 4086 } 4087 4087 } else { 4088 4088 l2cap_state_change(chan, BT_DISCONN); 4089 - __set_chan_timer(chan, HZ / 10); 4089 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 4090 4090 res = L2CAP_CR_SEC_BLOCK; 4091 4091 stat = L2CAP_CS_NO_INFO; 4092 4092 }
+19
net/mac80211/mlme.c
··· 1487 1487 int i, j, err; 1488 1488 bool have_higher_than_11mbit = false; 1489 1489 u16 ap_ht_cap_flags; 1490 + int min_rate = INT_MAX, min_rate_index = -1; 1490 1491 1491 1492 /* AssocResp and ReassocResp have identical structure */ 1492 1493 ··· 1554 1553 rates |= BIT(j); 1555 1554 if (is_basic) 1556 1555 basic_rates |= BIT(j); 1556 + if (rate < min_rate) { 1557 + min_rate = rate; 1558 + min_rate_index = j; 1559 + } 1557 1560 break; 1558 1561 } 1559 1562 } ··· 1575 1570 rates |= BIT(j); 1576 1571 if (is_basic) 1577 1572 basic_rates |= BIT(j); 1573 + if (rate < min_rate) { 1574 + min_rate = rate; 1575 + min_rate_index = j; 1576 + } 1578 1577 break; 1579 1578 } 1580 1579 } 1580 + } 1581 + 1582 + /* 1583 + * some buggy APs don't advertise basic_rates. use the lowest 1584 + * supported rate instead. 1585 + */ 1586 + if (unlikely(!basic_rates) && min_rate_index >= 0) { 1587 + printk(KERN_DEBUG "%s: No basic rates in AssocResp. " 1588 + "Using min supported rate instead.\n", sdata->name); 1589 + basic_rates = BIT(min_rate_index); 1581 1590 } 1582 1591 1583 1592 sta->sta.supp_rates[wk->chan->band] = rates;
+4 -4
net/mac80211/sta_info.c
··· 1354 1354 * Use MoreData flag to indicate whether there are 1355 1355 * more buffered frames for this STA 1356 1356 */ 1357 - if (!more_data) 1358 - hdr->frame_control &= 1359 - cpu_to_le16(~IEEE80211_FCTL_MOREDATA); 1360 - else 1357 + if (more_data || !skb_queue_empty(&frames)) 1361 1358 hdr->frame_control |= 1362 1359 cpu_to_le16(IEEE80211_FCTL_MOREDATA); 1360 + else 1361 + hdr->frame_control &= 1362 + cpu_to_le16(~IEEE80211_FCTL_MOREDATA); 1363 1363 1364 1364 if (ieee80211_is_data_qos(hdr->frame_control) || 1365 1365 ieee80211_is_qos_nullfunc(hdr->frame_control))
+7 -2
net/wireless/nl80211.c
··· 132 132 [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, 133 133 [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG }, 134 134 135 - [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY, 136 - .len = NL80211_HT_CAPABILITY_LEN }, 135 + [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN }, 137 136 138 137 [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 }, 139 138 [NL80211_ATTR_IE] = { .type = NLA_BINARY, ··· 1248 1249 } 1249 1250 1250 1251 if (!netdev) { 1252 + result = -EINVAL; 1253 + goto bad_res; 1254 + } 1255 + 1256 + if (netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 1257 + netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) { 1251 1258 result = -EINVAL; 1252 1259 goto bad_res; 1253 1260 }
+8 -5
net/wireless/scan.c
··· 259 259 { 260 260 const u8 *ie1 = cfg80211_find_ie(num, ies1, len1); 261 261 const u8 *ie2 = cfg80211_find_ie(num, ies2, len2); 262 - int r; 263 262 263 + /* equal if both missing */ 264 264 if (!ie1 && !ie2) 265 265 return 0; 266 - if (!ie1 || !ie2) 266 + /* sort missing IE before (left of) present IE */ 267 + if (!ie1) 267 268 return -1; 269 + if (!ie2) 270 + return 1; 268 271 269 - r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); 270 - if (r == 0 && ie1[1] != ie2[1]) 272 + /* sort by length first, then by contents */ 273 + if (ie1[1] != ie2[1]) 271 274 return ie2[1] - ie1[1]; 272 - return r; 275 + return memcmp(ie1 + 2, ie2 + 2, ie1[1]); 273 276 } 274 277 275 278 static bool is_bss(struct cfg80211_bss *a,