Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
llc: Fix double accounting of received packets
netfilter: nf_conntrack_expect: fix error path unwind in nf_conntrack_expect_init()
bluetooth: fix locking bug in the rfcomm socket cleanup handling
mac80211: fix alignment issue with compare_ether_addr()
mac80211: Fix for NULL pointer dereference in sta_info_get()
mac80211: fix a typo in ieee80211_handle_filtered_frame comment
rndis_wlan: add missing range check for power_output modparam
iwlwifi: fix rate scale TLC column selection bug
iwlwifi: fix exit from stay_in_table state
rndis_wlan: Make connections to TKIP PSK networks work
mac80211 : Fixes the status message for iwconfig
rt2x00: Use atomic interface iteration in irq context
rt2x00: Reset antenna RSSI after switch
rt2x00: Don't count retries as failure
rt2x00: Fix memleak in tx() path
mac80211: reorder channel and freq reporting in wext scan report
b43: Fix controller restart crash
mac80211: fix ieee80211_rx_bss_put/get imbalance
net/mac80211: always true conditionals
b43: Upload both beacon templates on initial load
...

+182 -72
+1
drivers/net/wireless/b43/b43.h
··· 737 struct ieee80211_tx_control beacon_txctl; 738 bool beacon0_uploaded; 739 bool beacon1_uploaded; 740 struct work_struct beacon_update_trigger; 741 742 /* The current QOS parameters for the 4 queues.
··· 737 struct ieee80211_tx_control beacon_txctl; 738 bool beacon0_uploaded; 739 bool beacon1_uploaded; 740 + bool beacon_templates_virgin; /* Never wrote the templates? */ 741 struct work_struct beacon_update_trigger; 742 743 /* The current QOS parameters for the 4 queues.
+54 -16
drivers/net/wireless/b43/main.c
··· 1544 kfree(probe_resp_data); 1545 } 1546 1547 static void handle_irq_beacon(struct b43_wldev *dev) 1548 { 1549 struct b43_wl *wl = dev->wl; ··· 1592 return; 1593 } 1594 1595 - if (!beacon0_valid) { 1596 - if (!wl->beacon0_uploaded) { 1597 - b43_write_beacon_template(dev, 0x68, 0x18); 1598 - b43_write_probe_resp_template(dev, 0x268, 0x4A, 1599 - &__b43_ratetable[3]); 1600 - wl->beacon0_uploaded = 1; 1601 - } 1602 cmd = b43_read32(dev, B43_MMIO_MACCMD); 1603 cmd |= B43_MACCMD_BEACON0_VALID; 1604 b43_write32(dev, B43_MMIO_MACCMD, cmd); 1605 - } else if (!beacon1_valid) { 1606 - if (!wl->beacon1_uploaded) { 1607 - b43_write_beacon_template(dev, 0x468, 0x1A); 1608 - wl->beacon1_uploaded = 1; 1609 } 1610 - cmd = b43_read32(dev, B43_MMIO_MACCMD); 1611 - cmd |= B43_MACCMD_BEACON1_VALID; 1612 - b43_write32(dev, B43_MMIO_MACCMD, cmd); 1613 } 1614 } 1615 ··· 4100 wl->filter_flags = 0; 4101 wl->radiotap_enabled = 0; 4102 b43_qos_clear(wl); 4103 4104 /* First register RFkill. 4105 * LEDs that are registered later depend on it. */ ··· 4271 goto out; 4272 } 4273 } 4274 - out: 4275 mutex_unlock(&wl->mutex); 4276 if (err) 4277 b43err(wl, "Controller restart FAILED\n"); ··· 4414 struct b43_wldev *wldev; 4415 struct b43_wl *wl; 4416 4417 wldev = ssb_get_drvdata(dev); 4418 wl = wldev->wl; 4419 - cancel_work_sync(&wldev->restart_work); 4420 b43_debugfs_remove_device(wldev); 4421 b43_wireless_core_detach(wldev); 4422 list_del(&wldev->list); ··· 4602 { 4603 struct b43_wl *wl = ssb_get_devtypedata(dev); 4604 struct b43_wldev *wldev = ssb_get_drvdata(dev); 4605 4606 B43_WARN_ON(!wl); 4607 if (wl->current_dev == wldev)
··· 1544 kfree(probe_resp_data); 1545 } 1546 1547 + static void b43_upload_beacon0(struct b43_wldev *dev) 1548 + { 1549 + struct b43_wl *wl = dev->wl; 1550 + 1551 + if (wl->beacon0_uploaded) 1552 + return; 1553 + b43_write_beacon_template(dev, 0x68, 0x18); 1554 + /* FIXME: Probe resp upload doesn't really belong here, 1555 + * but we don't use that feature anyway. */ 1556 + b43_write_probe_resp_template(dev, 0x268, 0x4A, 1557 + &__b43_ratetable[3]); 1558 + wl->beacon0_uploaded = 1; 1559 + } 1560 + 1561 + static void b43_upload_beacon1(struct b43_wldev *dev) 1562 + { 1563 + struct b43_wl *wl = dev->wl; 1564 + 1565 + if (wl->beacon1_uploaded) 1566 + return; 1567 + b43_write_beacon_template(dev, 0x468, 0x1A); 1568 + wl->beacon1_uploaded = 1; 1569 + } 1570 + 1571 static void handle_irq_beacon(struct b43_wldev *dev) 1572 { 1573 struct b43_wl *wl = dev->wl; ··· 1568 return; 1569 } 1570 1571 + if (unlikely(wl->beacon_templates_virgin)) { 1572 + /* We never uploaded a beacon before. 1573 + * Upload both templates now, but only mark one valid. */ 1574 + wl->beacon_templates_virgin = 0; 1575 + b43_upload_beacon0(dev); 1576 + b43_upload_beacon1(dev); 1577 cmd = b43_read32(dev, B43_MMIO_MACCMD); 1578 cmd |= B43_MACCMD_BEACON0_VALID; 1579 b43_write32(dev, B43_MMIO_MACCMD, cmd); 1580 + } else { 1581 + if (!beacon0_valid) { 1582 + b43_upload_beacon0(dev); 1583 + cmd = b43_read32(dev, B43_MMIO_MACCMD); 1584 + cmd |= B43_MACCMD_BEACON0_VALID; 1585 + b43_write32(dev, B43_MMIO_MACCMD, cmd); 1586 + } else if (!beacon1_valid) { 1587 + b43_upload_beacon1(dev); 1588 + cmd = b43_read32(dev, B43_MMIO_MACCMD); 1589 + cmd |= B43_MACCMD_BEACON1_VALID; 1590 + b43_write32(dev, B43_MMIO_MACCMD, cmd); 1591 } 1592 } 1593 } 1594 ··· 4073 wl->filter_flags = 0; 4074 wl->radiotap_enabled = 0; 4075 b43_qos_clear(wl); 4076 + wl->beacon0_uploaded = 0; 4077 + wl->beacon1_uploaded = 0; 4078 + wl->beacon_templates_virgin = 1; 4079 4080 /* First register RFkill. 4081 * LEDs that are registered later depend on it. */ ··· 4241 goto out; 4242 } 4243 } 4244 + out: 4245 + if (err) 4246 + wl->current_dev = NULL; /* Failed to init the dev. */ 4247 mutex_unlock(&wl->mutex); 4248 if (err) 4249 b43err(wl, "Controller restart FAILED\n"); ··· 4382 struct b43_wldev *wldev; 4383 struct b43_wl *wl; 4384 4385 + /* Do not cancel ieee80211-workqueue based work here. 4386 + * See comment in b43_remove(). */ 4387 + 4388 wldev = ssb_get_drvdata(dev); 4389 wl = wldev->wl; 4390 b43_debugfs_remove_device(wldev); 4391 b43_wireless_core_detach(wldev); 4392 list_del(&wldev->list); ··· 4568 { 4569 struct b43_wl *wl = ssb_get_devtypedata(dev); 4570 struct b43_wldev *wldev = ssb_get_drvdata(dev); 4571 + 4572 + /* We must cancel any work here before unregistering from ieee80211, 4573 + * as the ieee80211 unreg will destroy the workqueue. */ 4574 + cancel_work_sync(&wldev->restart_work); 4575 4576 B43_WARN_ON(!wl); 4577 if (wl->current_dev == wldev)
+1 -2
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
··· 1162 1163 /* Higher rate not available, use the original */ 1164 } else { 1165 - new_rate = rate; 1166 break; 1167 } 1168 } ··· 2008 * 2) Not just finishing up a search 2009 * 3) Allowing a new search 2010 */ 2011 - if (!update_lq && !done_search && !lq_sta->stay_in_tbl) { 2012 /* Save current throughput to compare with "search" throughput*/ 2013 lq_sta->last_tpt = current_tpt; 2014
··· 1162 1163 /* Higher rate not available, use the original */ 1164 } else { 1165 break; 1166 } 1167 } ··· 2009 * 2) Not just finishing up a search 2010 * 3) Allowing a new search 2011 */ 2012 + if (!update_lq && !done_search && !lq_sta->stay_in_tbl && window->counter) { 2013 /* Save current throughput to compare with "search" throughput*/ 2014 lq_sta->last_tpt = current_tpt; 2015
+63 -2
drivers/net/wireless/rndis_wlan.c
··· 116 #define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b) 117 #define OID_802_11_ADD_KEY ccpu2(0x0d01011d) 118 #define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e) 119 #define OID_802_11_PMKID ccpu2(0x0d010123) 120 #define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203) 121 #define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204) ··· 270 __le32 type; 271 __le32 value_offs; 272 __le32 value_length; 273 } __attribute__((packed)); 274 275 /* these have to match what is in wpa_supplicant */ ··· 695 return ret; 696 } 697 698 699 static int is_associated(struct usbnet *usbdev) 700 { ··· 2209 struct usbnet *usbdev = priv->usbdev; 2210 union iwreq_data evt; 2211 unsigned char bssid[ETH_ALEN]; 2212 - int ret; 2213 2214 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) { 2215 - ret = get_bssid(usbdev, bssid); 2216 2217 if (!ret) { 2218 evt.data.flags = 0; 2219 evt.data.length = 0; ··· 2469 priv->param_power_save = 0; 2470 else if (priv->param_power_save > 2) 2471 priv->param_power_save = 2; 2472 2473 if (priv->param_roamtrigger < -80) 2474 priv->param_roamtrigger = -80;
··· 116 #define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b) 117 #define OID_802_11_ADD_KEY ccpu2(0x0d01011d) 118 #define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e) 119 + #define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f) 120 #define OID_802_11_PMKID ccpu2(0x0d010123) 121 #define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203) 122 #define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204) ··· 269 __le32 type; 270 __le32 value_offs; 271 __le32 value_length; 272 + } __attribute__((packed)); 273 + 274 + struct ndis_80211_assoc_info { 275 + __le32 length; 276 + __le16 req_ies; 277 + struct req_ie { 278 + __le16 capa; 279 + __le16 listen_interval; 280 + u8 cur_ap_address[6]; 281 + } req_ie; 282 + __le32 req_ie_length; 283 + __le32 offset_req_ies; 284 + __le16 resp_ies; 285 + struct resp_ie { 286 + __le16 capa; 287 + __le16 status_code; 288 + __le16 assoc_id; 289 + } resp_ie; 290 + __le32 resp_ie_length; 291 + __le32 offset_resp_ies; 292 } __attribute__((packed)); 293 294 /* these have to match what is in wpa_supplicant */ ··· 674 return ret; 675 } 676 677 + static int get_association_info(struct usbnet *usbdev, 678 + struct ndis_80211_assoc_info *info, int len) 679 + { 680 + return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION, 681 + info, &len); 682 + } 683 684 static int is_associated(struct usbnet *usbdev) 685 { ··· 2182 struct usbnet *usbdev = priv->usbdev; 2183 union iwreq_data evt; 2184 unsigned char bssid[ETH_ALEN]; 2185 + struct ndis_80211_assoc_info *info; 2186 + int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32; 2187 + int ret, offset; 2188 2189 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) { 2190 + info = kzalloc(assoc_size, GFP_KERNEL); 2191 + if (!info) 2192 + goto get_bssid; 2193 2194 + /* Get association info IEs from device and send them back to 2195 + * userspace. */ 2196 + ret = get_association_info(usbdev, info, assoc_size); 2197 + if (!ret) { 2198 + evt.data.length = le32_to_cpu(info->req_ie_length); 2199 + if (evt.data.length > 0) { 2200 + offset = le32_to_cpu(info->offset_req_ies); 2201 + wireless_send_event(usbdev->net, 2202 + IWEVASSOCREQIE, &evt, 2203 + (char *)info + offset); 2204 + } 2205 + 2206 + evt.data.length = le32_to_cpu(info->resp_ie_length); 2207 + if (evt.data.length > 0) { 2208 + offset = le32_to_cpu(info->offset_resp_ies); 2209 + wireless_send_event(usbdev->net, 2210 + IWEVASSOCRESPIE, &evt, 2211 + (char *)info + offset); 2212 + } 2213 + } 2214 + 2215 + kfree(info); 2216 + 2217 + get_bssid: 2218 + ret = get_bssid(usbdev, bssid); 2219 if (!ret) { 2220 evt.data.flags = 0; 2221 evt.data.length = 0; ··· 2413 priv->param_power_save = 0; 2414 else if (priv->param_power_save > 2) 2415 priv->param_power_save = 2; 2416 + 2417 + if (priv->param_power_output < 0) 2418 + priv->param_power_output = 0; 2419 + else if (priv->param_power_output > 3) 2420 + priv->param_power_output = 3; 2421 2422 if (priv->param_roamtrigger < -80) 2423 priv->param_roamtrigger = -80;
+5
drivers/net/wireless/rt2x00/rt2x00.h
··· 328 return DEFAULT_RSSI; 329 } 330 331 static inline int rt2x00_get_link_ant_rssi_history(struct link *link, 332 enum antenna ant) 333 {
··· 328 return DEFAULT_RSSI; 329 } 330 331 + static inline void rt2x00_reset_link_ant_rssi(struct link *link) 332 + { 333 + link->ant.rssi_ant = 0; 334 + } 335 + 336 static inline int rt2x00_get_link_ant_rssi_history(struct link *link, 337 enum antenna ant) 338 {
+1
drivers/net/wireless/rt2x00/rt2x00config.c
··· 129 */ 130 rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA); 131 rt2x00lib_reset_link_tuner(rt2x00dev); 132 133 rt2x00dev->link.ant.active.rx = libconf.ant.rx; 134 rt2x00dev->link.ant.active.tx = libconf.ant.tx;
··· 129 */ 130 rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA); 131 rt2x00lib_reset_link_tuner(rt2x00dev); 132 + rt2x00_reset_link_ant_rssi(&rt2x00dev->link); 133 134 rt2x00dev->link.ant.active.rx = libconf.ant.rx; 135 rt2x00dev->link.ant.active.tx = libconf.ant.tx;
+4 -4
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 483 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 484 return; 485 486 - ieee80211_iterate_active_interfaces(rt2x00dev->hw, 487 - rt2x00lib_beacondone_iter, 488 - rt2x00dev); 489 490 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); 491 } ··· 507 * Update TX statistics. 508 */ 509 rt2x00dev->link.qual.tx_success += success; 510 - rt2x00dev->link.qual.tx_failed += txdesc->retry + fail; 511 512 /* 513 * Initialize TX status
··· 483 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 484 return; 485 486 + ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw, 487 + rt2x00lib_beacondone_iter, 488 + rt2x00dev); 489 490 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); 491 } ··· 507 * Update TX statistics. 508 */ 509 rt2x00dev->link.qual.tx_success += success; 510 + rt2x00dev->link.qual.tx_failed += fail; 511 512 /* 513 * Initialize TX status
+1
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 93 */ 94 if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) { 95 ieee80211_stop_queues(hw); 96 return NETDEV_TX_OK; 97 } 98
··· 93 */ 94 if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) { 95 ieee80211_stop_queues(hw); 96 + dev_kfree_skb_any(skb); 97 return NETDEV_TX_OK; 98 } 99
+1 -1
drivers/net/wireless/rtl8180_grf5101.c
··· 88 write_grf5101(dev, 0x0B, chan); 89 write_grf5101(dev, 0x07, 0x1000); 90 91 - grf5101_write_phy_antenna(dev, chan); 92 } 93 94 static void grf5101_rf_stop(struct ieee80211_hw *dev)
··· 88 write_grf5101(dev, 0x0B, chan); 89 write_grf5101(dev, 0x07, 0x1000); 90 91 + grf5101_write_phy_antenna(dev, channel); 92 } 93 94 static void grf5101_rf_stop(struct ieee80211_hw *dev)
+3 -2
drivers/net/wireless/rtl8180_max2820.c
··· 78 struct ieee80211_conf *conf) 79 { 80 struct rtl8180_priv *priv = dev->priv; 81 - int channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 82 unsigned int chan_idx = channel - 1; 83 u32 txpw = priv->channels[chan_idx].hw_value & 0xFF; 84 u32 chan = max2820_chan[chan_idx]; ··· 88 * sa2400, for MAXIM we do this directly from BB */ 89 rtl8180_write_phy(dev, 3, txpw); 90 91 - max2820_write_phy_antenna(dev, chan); 92 write_max2820(dev, 3, chan); 93 } 94
··· 78 struct ieee80211_conf *conf) 79 { 80 struct rtl8180_priv *priv = dev->priv; 81 + int channel = conf ? 82 + ieee80211_frequency_to_channel(conf->channel->center_freq) : 1; 83 unsigned int chan_idx = channel - 1; 84 u32 txpw = priv->channels[chan_idx].hw_value & 0xFF; 85 u32 chan = max2820_chan[chan_idx]; ··· 87 * sa2400, for MAXIM we do this directly from BB */ 88 rtl8180_write_phy(dev, 3, txpw); 89 90 + max2820_write_phy_antenna(dev, channel); 91 write_max2820(dev, 3, chan); 92 } 93
+1 -1
drivers/net/wireless/rtl8180_sa2400.c
··· 86 87 write_sa2400(dev, 7, txpw); 88 89 - sa2400_write_phy_antenna(dev, chan); 90 91 write_sa2400(dev, 0, chan); 92 write_sa2400(dev, 1, 0xbb50);
··· 86 87 write_sa2400(dev, 7, txpw); 88 89 + sa2400_write_phy_antenna(dev, channel); 90 91 write_sa2400(dev, 0, chan); 92 write_sa2400(dev, 1, 0xbb50);
+1 -1
net/bluetooth/rfcomm/core.c
··· 423 424 rfcomm_dlc_lock(d); 425 d->state = BT_CLOSED; 426 - rfcomm_dlc_unlock(d); 427 d->state_change(d, err); 428 429 skb_queue_purge(&d->tx_queue); 430 rfcomm_dlc_unlink(d);
··· 423 424 rfcomm_dlc_lock(d); 425 d->state = BT_CLOSED; 426 d->state_change(d, err); 427 + rfcomm_dlc_unlock(d); 428 429 skb_queue_purge(&d->tx_queue); 430 rfcomm_dlc_unlink(d);
+4 -9
net/dccp/ccids/ccid3.c
··· 193 194 /* 195 * Update Window Counter using the algorithm from [RFC 4342, 8.1]. 196 - * The algorithm is not applicable if RTT < 4 microseconds. 197 */ 198 static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hctx, 199 ktime_t now) 200 { 201 - u32 quarter_rtts; 202 - 203 - if (unlikely(hctx->ccid3hctx_rtt < 4)) /* avoid divide-by-zero */ 204 - return; 205 - 206 - quarter_rtts = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count); 207 - quarter_rtts /= hctx->ccid3hctx_rtt / 4; 208 209 if (quarter_rtts > 0) { 210 hctx->ccid3hctx_t_last_win_count = now; 211 - hctx->ccid3hctx_last_win_count += min_t(u32, quarter_rtts, 5); 212 hctx->ccid3hctx_last_win_count &= 0xF; /* mod 16 */ 213 } 214 }
··· 193 194 /* 195 * Update Window Counter using the algorithm from [RFC 4342, 8.1]. 196 + * As elsewhere, RTT > 0 is assumed by using dccp_sample_rtt(). 197 */ 198 static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hctx, 199 ktime_t now) 200 { 201 + u32 delta = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count), 202 + quarter_rtts = (4 * delta) / hctx->ccid3hctx_rtt; 203 204 if (quarter_rtts > 0) { 205 hctx->ccid3hctx_t_last_win_count = now; 206 + hctx->ccid3hctx_last_win_count += min(quarter_rtts, 5U); 207 hctx->ccid3hctx_last_win_count &= 0xF; /* mod 16 */ 208 } 209 }
+2 -2
net/dccp/ipv4.c
··· 739 * If P.type is not Data, Ack, or DataAck and P.X == 0 (the packet 740 * has short sequence numbers), drop packet and return 741 */ 742 - if (dh->dccph_type >= DCCP_PKT_DATA && 743 - dh->dccph_type <= DCCP_PKT_DATAACK && dh->dccph_x == 0) { 744 DCCP_WARN("P.type (%s) not Data || [Data]Ack, while P.X == 0\n", 745 dccp_packet_name(dh->dccph_type)); 746 return 1;
··· 739 * If P.type is not Data, Ack, or DataAck and P.X == 0 (the packet 740 * has short sequence numbers), drop packet and return 741 */ 742 + if ((dh->dccph_type < DCCP_PKT_DATA || 743 + dh->dccph_type > DCCP_PKT_DATAACK) && dh->dccph_x == 0) { 744 DCCP_WARN("P.type (%s) not Data || [Data]Ack, while P.X == 0\n", 745 dccp_packet_name(dh->dccph_type)); 746 return 1;
+5 -5
net/llc/llc_sap.c
··· 286 * 287 * Sends received pdus to the sap state machine. 288 */ 289 - static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb) 290 { 291 struct llc_sap_state_ev *ev = llc_sap_ev(skb); 292 293 ev->type = LLC_SAP_EV_TYPE_PDU; 294 ev->reason = 0; 295 llc_sap_state_process(sap, skb); 296 } 297 ··· 362 break; 363 364 sock_hold(sk); 365 - skb_set_owner_r(skb1, sk); 366 - llc_sap_rcv(sap, skb1); 367 sock_put(sk); 368 } 369 read_unlock_bh(&sap->sk_list.lock); ··· 382 } else { 383 struct sock *sk = llc_lookup_dgram(sap, &laddr); 384 if (sk) { 385 - skb_set_owner_r(skb, sk); 386 - llc_sap_rcv(sap, skb); 387 sock_put(sk); 388 } else 389 kfree_skb(skb);
··· 286 * 287 * Sends received pdus to the sap state machine. 288 */ 289 + static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb, 290 + struct sock *sk) 291 { 292 struct llc_sap_state_ev *ev = llc_sap_ev(skb); 293 294 ev->type = LLC_SAP_EV_TYPE_PDU; 295 ev->reason = 0; 296 + skb->sk = sk; 297 llc_sap_state_process(sap, skb); 298 } 299 ··· 360 break; 361 362 sock_hold(sk); 363 + llc_sap_rcv(sap, skb1, sk); 364 sock_put(sk); 365 } 366 read_unlock_bh(&sap->sk_list.lock); ··· 381 } else { 382 struct sock *sk = llc_lookup_dgram(sap, &laddr); 383 if (sk) { 384 + llc_sap_rcv(sap, skb, sk); 385 sock_put(sk); 386 } else 387 kfree_skb(skb);
+2 -2
net/mac80211/cfg.c
··· 672 if (params->vlan) { 673 sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 674 675 - if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN || 676 sdata->vif.type != IEEE80211_IF_TYPE_AP) 677 return -EINVAL; 678 } else ··· 760 if (params->vlan && params->vlan != sta->sdata->dev) { 761 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 762 763 - if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN || 764 vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { 765 rcu_read_unlock(); 766 return -EINVAL;
··· 672 if (params->vlan) { 673 sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 674 675 + if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN && 676 sdata->vif.type != IEEE80211_IF_TYPE_AP) 677 return -EINVAL; 678 } else ··· 760 if (params->vlan && params->vlan != sta->sdata->dev) { 761 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 762 763 + if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN && 764 vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { 765 rcu_read_unlock(); 766 return -EINVAL;
+1 -1
net/mac80211/main.c
··· 1313 /* 1314 * Clear the TX filter mask for this STA when sending the next 1315 * packet. If the STA went to power save mode, this will happen 1316 - * happen when it wakes up for the next time. 1317 */ 1318 sta->flags |= WLAN_STA_CLEAR_PS_FILT; 1319
··· 1313 /* 1314 * Clear the TX filter mask for this STA when sending the next 1315 * packet. If the STA went to power save mode, this will happen 1316 + * when it wakes up for the next time. 1317 */ 1318 sta->flags |= WLAN_STA_CLEAR_PS_FILT; 1319
+18 -15
net/mac80211/mlme.c
··· 1325 1326 /* prepare reordering buffer */ 1327 tid_agg_rx->reorder_buf = 1328 - kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC); 1329 if (!tid_agg_rx->reorder_buf) { 1330 if (net_ratelimit()) 1331 printk(KERN_ERR "can not allocate reordering buffer " ··· 1334 goto end; 1335 } 1336 memset(tid_agg_rx->reorder_buf, 0, 1337 - buf_size * sizeof(struct sk_buf *)); 1338 1339 if (local->ops->ampdu_action) 1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, ··· 1614 * only one argument, and both sta_info and TID are needed, so init 1615 * flow in sta_info_create gives the TID as data, while the timer_to_id 1616 * array gives the sta through container_of */ 1617 - u16 tid = *(int *)data; 1618 struct sta_info *temp_sta = container_of((void *)data, 1619 struct sta_info, timer_to_tid[tid]); 1620 ··· 1662 void sta_rx_agg_session_timer_expired(unsigned long data) 1663 { 1664 /* not an elegant detour, but there is no choice as the timer passes 1665 - * only one argument, and verious sta_info are needed here, so init 1666 * flow in sta_info_create gives the TID as data, while the timer_to_id 1667 * array gives the sta through container_of */ 1668 u8 *ptid = (u8 *)data; ··· 2478 2479 ifsta->state = IEEE80211_IBSS_JOINED; 2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); 2481 - 2482 - ieee80211_rx_bss_put(dev, bss); 2483 2484 return res; 2485 } ··· 3521 struct ieee80211_supported_band *sband; 3522 u8 bssid[ETH_ALEN], *pos; 3523 int i; 3524 DECLARE_MAC_BUF(mac); 3525 3526 #if 0 ··· 3566 *pos++ = (u8) (rate / 5); 3567 } 3568 3569 - return ieee80211_sta_join_ibss(dev, ifsta, bss); 3570 } 3571 3572 ··· 3616 (bss = ieee80211_rx_bss_get(dev, bssid, 3617 local->hw.conf.channel->center_freq, 3618 ifsta->ssid, ifsta->ssid_len))) { 3619 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" 3620 " based on configured SSID\n", 3621 dev->name, print_mac(mac, bssid)); 3622 - return ieee80211_sta_join_ibss(dev, ifsta, bss); 3623 } 3624 #ifdef CONFIG_MAC80211_IBSS_DEBUG 3625 printk(KERN_DEBUG " did not try to join ibss\n"); ··· 4099 4100 memset(&iwe, 0, sizeof(iwe)); 4101 iwe.cmd = SIOCGIWFREQ; 4102 - iwe.u.freq.m = bss->freq; 4103 - iwe.u.freq.e = 6; 4104 - current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4105 - IW_EV_FREQ_LEN); 4106 - 4107 - memset(&iwe, 0, sizeof(iwe)); 4108 - iwe.cmd = SIOCGIWFREQ; 4109 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); 4110 iwe.u.freq.e = 0; 4111 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4112 IW_EV_FREQ_LEN); 4113 4114 memset(&iwe, 0, sizeof(iwe)); 4115 iwe.cmd = IWEVQUAL; 4116 iwe.u.qual.qual = bss->signal;
··· 1325 1326 /* prepare reordering buffer */ 1327 tid_agg_rx->reorder_buf = 1328 + kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC); 1329 if (!tid_agg_rx->reorder_buf) { 1330 if (net_ratelimit()) 1331 printk(KERN_ERR "can not allocate reordering buffer " ··· 1334 goto end; 1335 } 1336 memset(tid_agg_rx->reorder_buf, 0, 1337 + buf_size * sizeof(struct sk_buff *)); 1338 1339 if (local->ops->ampdu_action) 1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, ··· 1614 * only one argument, and both sta_info and TID are needed, so init 1615 * flow in sta_info_create gives the TID as data, while the timer_to_id 1616 * array gives the sta through container_of */ 1617 + u16 tid = *(u8 *)data; 1618 struct sta_info *temp_sta = container_of((void *)data, 1619 struct sta_info, timer_to_tid[tid]); 1620 ··· 1662 void sta_rx_agg_session_timer_expired(unsigned long data) 1663 { 1664 /* not an elegant detour, but there is no choice as the timer passes 1665 + * only one argument, and various sta_info are needed here, so init 1666 * flow in sta_info_create gives the TID as data, while the timer_to_id 1667 * array gives the sta through container_of */ 1668 u8 *ptid = (u8 *)data; ··· 2478 2479 ifsta->state = IEEE80211_IBSS_JOINED; 2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); 2481 2482 return res; 2483 } ··· 3523 struct ieee80211_supported_band *sband; 3524 u8 bssid[ETH_ALEN], *pos; 3525 int i; 3526 + int ret; 3527 DECLARE_MAC_BUF(mac); 3528 3529 #if 0 ··· 3567 *pos++ = (u8) (rate / 5); 3568 } 3569 3570 + ret = ieee80211_sta_join_ibss(dev, ifsta, bss); 3571 + ieee80211_rx_bss_put(dev, bss); 3572 + return ret; 3573 } 3574 3575 ··· 3615 (bss = ieee80211_rx_bss_get(dev, bssid, 3616 local->hw.conf.channel->center_freq, 3617 ifsta->ssid, ifsta->ssid_len))) { 3618 + int ret; 3619 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" 3620 " based on configured SSID\n", 3621 dev->name, print_mac(mac, bssid)); 3622 + ret = ieee80211_sta_join_ibss(dev, ifsta, bss); 3623 + ieee80211_rx_bss_put(dev, bss); 3624 + return ret; 3625 } 3626 #ifdef CONFIG_MAC80211_IBSS_DEBUG 3627 printk(KERN_DEBUG " did not try to join ibss\n"); ··· 4095 4096 memset(&iwe, 0, sizeof(iwe)); 4097 iwe.cmd = SIOCGIWFREQ; 4098 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); 4099 iwe.u.freq.e = 0; 4100 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4101 IW_EV_FREQ_LEN); 4102 4103 + memset(&iwe, 0, sizeof(iwe)); 4104 + iwe.cmd = SIOCGIWFREQ; 4105 + iwe.u.freq.m = bss->freq; 4106 + iwe.u.freq.e = 6; 4107 + current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4108 + IW_EV_FREQ_LEN); 4109 memset(&iwe, 0, sizeof(iwe)); 4110 iwe.cmd = IWEVQUAL; 4111 iwe.u.qual.qual = bss->signal;
+2 -2
net/mac80211/rx.c
··· 1091 u16 fc, hdrlen, ethertype; 1092 u8 *payload; 1093 u8 dst[ETH_ALEN]; 1094 - u8 src[ETH_ALEN]; 1095 struct sk_buff *skb = rx->skb; 1096 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1097 DECLARE_MAC_BUF(mac); ··· 1234 */ 1235 static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx) 1236 { 1237 - static const u8 pae_group_addr[ETH_ALEN] 1238 = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; 1239 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; 1240
··· 1091 u16 fc, hdrlen, ethertype; 1092 u8 *payload; 1093 u8 dst[ETH_ALEN]; 1094 + u8 src[ETH_ALEN] __aligned(2); 1095 struct sk_buff *skb = rx->skb; 1096 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1097 DECLARE_MAC_BUF(mac); ··· 1234 */ 1235 static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx) 1236 { 1237 + static const u8 pae_group_addr[ETH_ALEN] __aligned(2) 1238 = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; 1239 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; 1240
+2 -2
net/mac80211/util.c
··· 34 35 /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ 36 /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 37 - const unsigned char rfc1042_header[] = 38 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 39 40 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 41 - const unsigned char bridge_tunnel_header[] = 42 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; 43 44
··· 34 35 /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ 36 /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 37 + const unsigned char rfc1042_header[] __aligned(2) = 38 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 39 40 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 41 + const unsigned char bridge_tunnel_header[] __aligned(2) = 42 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; 43 44
+8 -3
net/mac80211/wext.c
··· 489 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 490 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 491 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 492 - ap_addr->sa_family = ARPHRD_ETHER; 493 - memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); 494 - return 0; 495 } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { 496 ap_addr->sa_family = ARPHRD_ETHER; 497 memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
··· 489 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 490 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 491 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 492 + if (sdata->u.sta.state == IEEE80211_ASSOCIATED) { 493 + ap_addr->sa_family = ARPHRD_ETHER; 494 + memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); 495 + return 0; 496 + } else { 497 + memset(&ap_addr->sa_data, 0, ETH_ALEN); 498 + return 0; 499 + } 500 } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { 501 ap_addr->sa_family = ARPHRD_ETHER; 502 memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
+2 -2
net/netfilter/nf_conntrack_expect.c
··· 587 return 0; 588 589 err3: 590 nf_ct_free_hashtable(nf_ct_expect_hash, nf_ct_expect_vmalloc, 591 nf_ct_expect_hsize); 592 - err2: 593 - kmem_cache_destroy(nf_ct_expect_cachep); 594 err1: 595 return err; 596 }
··· 587 return 0; 588 589 err3: 590 + kmem_cache_destroy(nf_ct_expect_cachep); 591 + err2: 592 nf_ct_free_hashtable(nf_ct_expect_hash, nf_ct_expect_vmalloc, 593 nf_ct_expect_hsize); 594 err1: 595 return err; 596 }