提交 2ad20802 编写于 作者: L Linus Torvalds

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)
  bonding: fix panic if initialization fails
  IXP4xx: complete Ethernet netdev setup before calling register_netdev().
  IXP4xx: use "ENODEV" instead of "ENOSYS" in module initialization.
  ipvs: Fix IPv4 FWMARK virtual services
  ipv4: Make INET_LRO a bool instead of tristate.
  net: remove stale reference to fastroute from Kconfig help text
  net: update skb_recycle_check() for hardware timestamping changes
  bnx2: Fix panic in bnx2_poll_work().
  net-sched: fix bfifo default limit
  igb: resolve panic on shutdown when SR-IOV is enabled
  wimax: oops: wimax_dev_add() is the only one that can initialize the state
  wimax: fix oops if netlink fails to add attribute
  Bluetooth: Move dev_set_name() to a context that can sleep
  netfilter: ctnetlink: fix wrong message type in user updates
  netfilter: xt_cluster: fix use of cluster match with 32 nodes
  netfilter: ip6t_ipv6header: fix match on packets ending with NEXTHDR_NONE
  netfilter: add missing linux/types.h include to xt_LED.h
  mac80211: pid, fix memory corruption
  mac80211: minstrel, fix memory corruption
  cfg80211: fix comment on regulatory hint processing
  ...
...@@ -714,7 +714,7 @@ static int __init npe_init_module(void) ...@@ -714,7 +714,7 @@ static int __init npe_init_module(void)
} }
if (!found) if (!found)
return -ENOSYS; return -ENODEV;
return 0; return 0;
} }
......
...@@ -338,12 +338,12 @@ static int ixp4xx_mdio_register(void) ...@@ -338,12 +338,12 @@ static int ixp4xx_mdio_register(void)
if (cpu_is_ixp43x()) { if (cpu_is_ixp43x()) {
/* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */
if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH))
return -ENOSYS; return -ENODEV;
mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT;
} else { } else {
/* All MII PHY accesses use NPE-B Ethernet registers */ /* All MII PHY accesses use NPE-B Ethernet registers */
if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0))
return -ENOSYS; return -ENODEV;
mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
} }
...@@ -1174,7 +1174,7 @@ static int __devinit eth_init_one(struct platform_device *pdev) ...@@ -1174,7 +1174,7 @@ static int __devinit eth_init_one(struct platform_device *pdev)
regs_phys = IXP4XX_EthC_BASE_PHYS; regs_phys = IXP4XX_EthC_BASE_PHYS;
break; break;
default: default:
err = -ENOSYS; err = -ENODEV;
goto err_free; goto err_free;
} }
...@@ -1189,15 +1189,10 @@ static int __devinit eth_init_one(struct platform_device *pdev) ...@@ -1189,15 +1189,10 @@ static int __devinit eth_init_one(struct platform_device *pdev)
goto err_free; goto err_free;
} }
if (register_netdev(dev)) {
err = -EIO;
goto err_npe_rel;
}
port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name);
if (!port->mem_res) { if (!port->mem_res) {
err = -EBUSY; err = -EBUSY;
goto err_unreg; goto err_npe_rel;
} }
port->plat = plat; port->plat = plat;
...@@ -1215,20 +1210,25 @@ static int __devinit eth_init_one(struct platform_device *pdev) ...@@ -1215,20 +1210,25 @@ static int __devinit eth_init_one(struct platform_device *pdev)
snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy);
port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
PHY_INTERFACE_MODE_MII); PHY_INTERFACE_MODE_MII);
if (IS_ERR(port->phydev)) { if ((err = IS_ERR(port->phydev)))
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); goto err_free_mem;
return PTR_ERR(port->phydev);
}
port->phydev->irq = PHY_POLL; port->phydev->irq = PHY_POLL;
if ((err = register_netdev(dev)))
goto err_phy_dis;
printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy,
npe_name(port->npe)); npe_name(port->npe));
return 0; return 0;
err_unreg: err_phy_dis:
unregister_netdev(dev); phy_disconnect(port->phydev);
err_free_mem:
npe_port_tab[NPE_ID(port->id)] = NULL;
platform_set_drvdata(pdev, NULL);
release_resource(port->mem_res);
err_npe_rel: err_npe_rel:
npe_release(port->npe); npe_release(port->npe);
err_free: err_free:
...@@ -1242,6 +1242,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev) ...@@ -1242,6 +1242,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev)
struct port *port = netdev_priv(dev); struct port *port = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
phy_disconnect(port->phydev);
npe_port_tab[NPE_ID(port->id)] = NULL; npe_port_tab[NPE_ID(port->id)] = NULL;
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
npe_release(port->npe); npe_release(port->npe);
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
#define DRV_MODULE_NAME "bnx2" #define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "2.0.0" #define DRV_MODULE_VERSION "2.0.1"
#define DRV_MODULE_RELDATE "April 2, 2009" #define DRV_MODULE_RELDATE "May 6, 2009"
#define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-4.6.16.fw" #define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-4.6.16.fw"
#define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-4.6.16.fw" #define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-4.6.16.fw"
#define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-4.6.17.fw" #define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-4.6.17.fw"
...@@ -2600,6 +2600,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) ...@@ -2600,6 +2600,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi)
/* Tell compiler that status block fields can change. */ /* Tell compiler that status block fields can change. */
barrier(); barrier();
cons = *bnapi->hw_tx_cons_ptr; cons = *bnapi->hw_tx_cons_ptr;
barrier();
if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT)) if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT))
cons++; cons++;
return cons; return cons;
...@@ -2879,6 +2880,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) ...@@ -2879,6 +2880,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi)
/* Tell compiler that status block fields can change. */ /* Tell compiler that status block fields can change. */
barrier(); barrier();
cons = *bnapi->hw_rx_cons_ptr; cons = *bnapi->hw_rx_cons_ptr;
barrier();
if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)) if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT))
cons++; cons++;
return cons; return cons;
......
...@@ -5181,7 +5181,6 @@ static int __init bonding_init(void) ...@@ -5181,7 +5181,6 @@ static int __init bonding_init(void)
{ {
int i; int i;
int res; int res;
struct bonding *bond;
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
...@@ -5212,13 +5211,6 @@ static int __init bonding_init(void) ...@@ -5212,13 +5211,6 @@ static int __init bonding_init(void)
goto out; goto out;
err: err:
list_for_each_entry(bond, &bond_dev_list, bond_list) {
bond_work_cancel_all(bond);
destroy_workqueue(bond->wq);
}
bond_destroy_sysfs();
rtnl_lock(); rtnl_lock();
bond_free_all(); bond_free_all();
rtnl_unlock(); rtnl_unlock();
......
...@@ -2006,7 +2006,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -2006,7 +2006,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 rctl; u32 rctl;
u32 srrctl = 0; u32 srrctl = 0;
int i, j; int i;
rctl = rd32(E1000_RCTL); rctl = rd32(E1000_RCTL);
...@@ -2071,8 +2071,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -2071,8 +2071,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
if (adapter->vfs_allocated_count) { if (adapter->vfs_allocated_count) {
u32 vmolr; u32 vmolr;
j = adapter->rx_ring[0].reg_idx;
/* set all queue drop enable bits */ /* set all queue drop enable bits */
wr32(E1000_QDE, ALL_QUEUES); wr32(E1000_QDE, ALL_QUEUES);
srrctl |= E1000_SRRCTL_DROP_EN; srrctl |= E1000_SRRCTL_DROP_EN;
...@@ -2080,16 +2078,16 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -2080,16 +2078,16 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
/* disable queue 0 to prevent tail write w/o re-config */ /* disable queue 0 to prevent tail write w/o re-config */
wr32(E1000_RXDCTL(0), 0); wr32(E1000_RXDCTL(0), 0);
vmolr = rd32(E1000_VMOLR(j)); vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count));
if (rctl & E1000_RCTL_LPE) if (rctl & E1000_RCTL_LPE)
vmolr |= E1000_VMOLR_LPE; vmolr |= E1000_VMOLR_LPE;
if (adapter->num_rx_queues > 0) if (adapter->num_rx_queues > 1)
vmolr |= E1000_VMOLR_RSSE; vmolr |= E1000_VMOLR_RSSE;
wr32(E1000_VMOLR(j), vmolr); wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr);
} }
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
j = adapter->rx_ring[i].reg_idx; int j = adapter->rx_ring[i].reg_idx;
wr32(E1000_SRRCTL(j), srrctl); wr32(E1000_SRRCTL(j), srrctl);
} }
......
...@@ -1249,7 +1249,7 @@ static int __devinit hss_init_one(struct platform_device *pdev) ...@@ -1249,7 +1249,7 @@ static int __devinit hss_init_one(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
if ((port->npe = npe_request(0)) == NULL) { if ((port->npe = npe_request(0)) == NULL) {
err = -ENOSYS; err = -ENODEV;
goto err_free; goto err_free;
} }
...@@ -1311,7 +1311,7 @@ static int __init hss_init_module(void) ...@@ -1311,7 +1311,7 @@ static int __init hss_init_module(void)
if ((ixp4xx_read_feature_bits() & if ((ixp4xx_read_feature_bits() &
(IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) != (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) !=
(IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS))
return -ENOSYS; return -ENODEV;
spin_lock_init(&npe_lock); spin_lock_init(&npe_lock);
......
...@@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, ...@@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
{ {
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
__le16 key_flags = 0;
key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == priv->hw_params.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
...@@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, ...@@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
"no space for a new key"); "no space for a new key");
priv->stations[sta_id].sta.key.key_flags = key_flags;
/* This copy is acutally not needed: we get the key with each TX */ /* This copy is acutally not needed: we get the key with each TX */
memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
...@@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv, ...@@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
{ {
u8 sta_id = IWL_INVALID_STATION; u8 sta_id = IWL_INVALID_STATION;
unsigned long flags; unsigned long flags;
__le16 key_flags = 0;
int i; int i;
DECLARE_MAC_BUF(mac);
sta_id = iwl_find_station(priv, addr); sta_id = iwl_find_station(priv, addr);
if (sta_id == IWL_INVALID_STATION) { if (sta_id == IWL_INVALID_STATION) {
...@@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv, ...@@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
return; return;
} }
key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == priv->hw_params.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;
spin_lock_irqsave(&priv->sta_lock, flags); spin_lock_irqsave(&priv->sta_lock, flags);
priv->stations[sta_id].sta.key.key_flags = key_flags;
priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
......
...@@ -1744,7 +1744,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx ...@@ -1744,7 +1744,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx
rxq->bd = NULL; rxq->bd = NULL;
rxq->rb_stts = NULL; rxq->rb_stts = NULL;
} }
EXPORT_SYMBOL(iwl3945_rx_queue_free);
/* Convert linear signal-to-noise ratio into dB */ /* Convert linear signal-to-noise ratio into dB */
......
#ifndef _XT_LED_H #ifndef _XT_LED_H
#define _XT_LED_H #define _XT_LED_H
#include <linux/types.h>
struct xt_led_info { struct xt_led_info {
char id[27]; /* Unique ID for this trigger in the LED class */ char id[27]; /* Unique ID for this trigger in the LED class */
__u8 always_blink; /* Blink even if the LED is already on */ __u8 always_blink; /* Blink even if the LED is already on */
......
...@@ -12,4 +12,6 @@ struct xt_cluster_match_info { ...@@ -12,4 +12,6 @@ struct xt_cluster_match_info {
u_int32_t flags; u_int32_t flags;
}; };
#define XT_CLUSTER_NODES_MAX 32
#endif /* _XT_CLUSTER_MATCH_H */ #endif /* _XT_CLUSTER_MATCH_H */
...@@ -119,12 +119,6 @@ menuconfig NETFILTER ...@@ -119,12 +119,6 @@ menuconfig NETFILTER
<file:Documentation/Changes> under "iptables" for the location of <file:Documentation/Changes> under "iptables" for the location of
these packages. these packages.
Make sure to say N to "Fast switching" below if you intend to say Y
here, as Fast switching currently bypasses netfilter.
Chances are that you should say Y here if you compile a kernel which
will run as a router and N for regular hosts. If unsure, say N.
if NETFILTER if NETFILTER
config NETFILTER_DEBUG config NETFILTER_DEBUG
......
...@@ -88,10 +88,13 @@ static struct device_type bt_link = { ...@@ -88,10 +88,13 @@ static struct device_type bt_link = {
static void add_conn(struct work_struct *work) static void add_conn(struct work_struct *work)
{ {
struct hci_conn *conn = container_of(work, struct hci_conn, work_add); struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
struct hci_dev *hdev = conn->hdev;
/* ensure previous del is complete */ /* ensure previous del is complete */
flush_work(&conn->work_del); flush_work(&conn->work_del);
dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
if (device_add(&conn->dev) < 0) { if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device"); BT_ERR("Failed to register connection device");
return; return;
...@@ -154,12 +157,8 @@ void hci_conn_init_sysfs(struct hci_conn *conn) ...@@ -154,12 +157,8 @@ void hci_conn_init_sysfs(struct hci_conn *conn)
void hci_conn_add_sysfs(struct hci_conn *conn) void hci_conn_add_sysfs(struct hci_conn *conn)
{ {
struct hci_dev *hdev = conn->hdev;
BT_DBG("conn %p", conn); BT_DBG("conn %p", conn);
dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
queue_work(bt_workq, &conn->work_add); queue_work(bt_workq, &conn->work_add);
} }
......
...@@ -502,7 +502,9 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) ...@@ -502,7 +502,9 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size)
shinfo->gso_segs = 0; shinfo->gso_segs = 0;
shinfo->gso_type = 0; shinfo->gso_type = 0;
shinfo->ip6_frag_id = 0; shinfo->ip6_frag_id = 0;
shinfo->tx_flags.flags = 0;
shinfo->frag_list = NULL; shinfo->frag_list = NULL;
memset(&shinfo->hwtstamps, 0, sizeof(shinfo->hwtstamps));
memset(skb, 0, offsetof(struct sk_buff, tail)); memset(skb, 0, offsetof(struct sk_buff, tail));
skb->data = skb->head + NET_SKB_PAD; skb->data = skb->head + NET_SKB_PAD;
......
...@@ -407,7 +407,7 @@ config INET_XFRM_MODE_BEET ...@@ -407,7 +407,7 @@ config INET_XFRM_MODE_BEET
If unsure, say Y. If unsure, say Y.
config INET_LRO config INET_LRO
tristate "Large Receive Offload (ipv4/tcp)" bool "Large Receive Offload (ipv4/tcp)"
---help--- ---help---
Support for Large Receive Offload (ipv4/tcp). Support for Large Receive Offload (ipv4/tcp).
......
...@@ -50,14 +50,14 @@ ipv6header_mt6(const struct sk_buff *skb, const struct xt_match_param *par) ...@@ -50,14 +50,14 @@ ipv6header_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
struct ipv6_opt_hdr _hdr; struct ipv6_opt_hdr _hdr;
int hdrlen; int hdrlen;
/* Is there enough space for the next ext header? */
if (len < (int)sizeof(struct ipv6_opt_hdr))
return false;
/* No more exthdr -> evaluate */ /* No more exthdr -> evaluate */
if (nexthdr == NEXTHDR_NONE) { if (nexthdr == NEXTHDR_NONE) {
temp |= MASK_NONE; temp |= MASK_NONE;
break; break;
} }
/* Is there enough space for the next ext header? */
if (len < (int)sizeof(struct ipv6_opt_hdr))
return false;
/* ESP -> evaluate */ /* ESP -> evaluate */
if (nexthdr == NEXTHDR_ESP) { if (nexthdr == NEXTHDR_ESP) {
temp |= MASK_ESP; temp |= MASK_ESP;
......
...@@ -476,7 +476,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) ...@@ -476,7 +476,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
return NULL; return NULL;
for (i = 0; i < IEEE80211_NUM_BANDS; i++) { for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = hw->wiphy->bands[hw->conf.channel->band]; sband = hw->wiphy->bands[i];
if (sband->n_bitrates > max_rates) if (sband->n_bitrates > max_rates)
max_rates = sband->n_bitrates; max_rates = sband->n_bitrates;
} }
......
...@@ -317,13 +317,44 @@ rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband, ...@@ -317,13 +317,44 @@ rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *priv_sta) struct ieee80211_sta *sta, void *priv_sta)
{ {
struct rc_pid_sta_info *spinfo = priv_sta; struct rc_pid_sta_info *spinfo = priv_sta;
struct rc_pid_info *pinfo = priv;
struct rc_pid_rateinfo *rinfo = pinfo->rinfo;
struct sta_info *si; struct sta_info *si;
int i, j, tmp;
bool s;
/* TODO: This routine should consider using RSSI from previous packets /* TODO: This routine should consider using RSSI from previous packets
* as we need to have IEEE 802.1X auth succeed immediately after assoc.. * as we need to have IEEE 802.1X auth succeed immediately after assoc..
* Until that method is implemented, we will use the lowest supported * Until that method is implemented, we will use the lowest supported
* rate as a workaround. */ * rate as a workaround. */
/* Sort the rates. This is optimized for the most common case (i.e.
* almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed
* mapping too. */
for (i = 0; i < sband->n_bitrates; i++) {
rinfo[i].index = i;
rinfo[i].rev_index = i;
if (RC_PID_FAST_START)
rinfo[i].diff = 0;
else
rinfo[i].diff = i * pinfo->norm_offset;
}
for (i = 1; i < sband->n_bitrates; i++) {
s = 0;
for (j = 0; j < sband->n_bitrates - i; j++)
if (unlikely(sband->bitrates[rinfo[j].index].bitrate >
sband->bitrates[rinfo[j + 1].index].bitrate)) {
tmp = rinfo[j].index;
rinfo[j].index = rinfo[j + 1].index;
rinfo[j + 1].index = tmp;
rinfo[rinfo[j].index].rev_index = j;
rinfo[rinfo[j + 1].index].rev_index = j + 1;
s = 1;
}
if (!s)
break;
}
spinfo->txrate_idx = rate_lowest_index(sband, sta); spinfo->txrate_idx = rate_lowest_index(sband, sta);
/* HACK */ /* HACK */
si = container_of(sta, struct sta_info, sta); si = container_of(sta, struct sta_info, sta);
...@@ -336,21 +367,22 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw, ...@@ -336,21 +367,22 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
struct rc_pid_info *pinfo; struct rc_pid_info *pinfo;
struct rc_pid_rateinfo *rinfo; struct rc_pid_rateinfo *rinfo;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
int i, j, tmp; int i, max_rates = 0;
bool s;
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
struct rc_pid_debugfs_entries *de; struct rc_pid_debugfs_entries *de;
#endif #endif
sband = hw->wiphy->bands[hw->conf.channel->band];
pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC); pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC);
if (!pinfo) if (!pinfo)
return NULL; return NULL;
/* We can safely assume that sband won't change unless we get for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
* reinitialized. */ sband = hw->wiphy->bands[i];
rinfo = kmalloc(sizeof(*rinfo) * sband->n_bitrates, GFP_ATOMIC); if (sband->n_bitrates > max_rates)
max_rates = sband->n_bitrates;
}
rinfo = kmalloc(sizeof(*rinfo) * max_rates, GFP_ATOMIC);
if (!rinfo) { if (!rinfo) {
kfree(pinfo); kfree(pinfo);
return NULL; return NULL;
...@@ -368,33 +400,6 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw, ...@@ -368,33 +400,6 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
pinfo->rinfo = rinfo; pinfo->rinfo = rinfo;
pinfo->oldrate = 0; pinfo->oldrate = 0;
/* Sort the rates. This is optimized for the most common case (i.e.
* almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed
* mapping too. */
for (i = 0; i < sband->n_bitrates; i++) {
rinfo[i].index = i;
rinfo[i].rev_index = i;
if (RC_PID_FAST_START)
rinfo[i].diff = 0;
else
rinfo[i].diff = i * pinfo->norm_offset;
}
for (i = 1; i < sband->n_bitrates; i++) {
s = 0;
for (j = 0; j < sband->n_bitrates - i; j++)
if (unlikely(sband->bitrates[rinfo[j].index].bitrate >
sband->bitrates[rinfo[j + 1].index].bitrate)) {
tmp = rinfo[j].index;
rinfo[j].index = rinfo[j + 1].index;
rinfo[j + 1].index = tmp;
rinfo[rinfo[j].index].rev_index = j;
rinfo[rinfo[j + 1].index].rev_index = j + 1;
s = 1;
}
if (!s)
break;
}
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
de = &pinfo->dentries; de = &pinfo->dentries;
de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR, de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR,
......
...@@ -772,7 +772,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) ...@@ -772,7 +772,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
hdrlen = ieee80211_hdrlen(hdr->frame_control); hdrlen = ieee80211_hdrlen(hdr->frame_control);
/* internal error, why is TX_FRAGMENTED set? */ /* internal error, why is TX_FRAGMENTED set? */
if (WARN_ON(skb->len <= frag_threshold)) if (WARN_ON(skb->len + FCS_LEN <= frag_threshold))
return TX_DROP; return TX_DROP;
/* /*
......
...@@ -260,7 +260,10 @@ struct ip_vs_conn *ip_vs_ct_in_get ...@@ -260,7 +260,10 @@ struct ip_vs_conn *ip_vs_ct_in_get
list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (cp->af == af && if (cp->af == af &&
ip_vs_addr_equal(af, s_addr, &cp->caddr) && ip_vs_addr_equal(af, s_addr, &cp->caddr) &&
ip_vs_addr_equal(af, d_addr, &cp->vaddr) && /* protocol should only be IPPROTO_IP if
* d_addr is a fwmark */
ip_vs_addr_equal(protocol == IPPROTO_IP ? AF_UNSPEC : af,
d_addr, &cp->vaddr) &&
s_port == cp->cport && d_port == cp->vport && s_port == cp->cport && d_port == cp->vport &&
cp->flags & IP_VS_CONN_F_TEMPLATE && cp->flags & IP_VS_CONN_F_TEMPLATE &&
protocol == cp->protocol) { protocol == cp->protocol) {
...@@ -698,7 +701,9 @@ ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport, ...@@ -698,7 +701,9 @@ ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport,
cp->cport = cport; cp->cport = cport;
ip_vs_addr_copy(af, &cp->vaddr, vaddr); ip_vs_addr_copy(af, &cp->vaddr, vaddr);
cp->vport = vport; cp->vport = vport;
ip_vs_addr_copy(af, &cp->daddr, daddr); /* proto should only be IPPROTO_IP if d_addr is a fwmark */
ip_vs_addr_copy(proto == IPPROTO_IP ? AF_UNSPEC : af,
&cp->daddr, daddr);
cp->dport = dport; cp->dport = dport;
cp->flags = flags; cp->flags = flags;
spin_lock_init(&cp->lock); spin_lock_init(&cp->lock);
......
...@@ -278,7 +278,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, ...@@ -278,7 +278,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
*/ */
if (svc->fwmark) { if (svc->fwmark) {
union nf_inet_addr fwmark = { union nf_inet_addr fwmark = {
.all = { 0, 0, 0, htonl(svc->fwmark) } .ip = htonl(svc->fwmark)
}; };
ct = ip_vs_ct_in_get(svc->af, IPPROTO_IP, &snet, 0, ct = ip_vs_ct_in_get(svc->af, IPPROTO_IP, &snet, 0,
...@@ -306,7 +306,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, ...@@ -306,7 +306,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
*/ */
if (svc->fwmark) { if (svc->fwmark) {
union nf_inet_addr fwmark = { union nf_inet_addr fwmark = {
.all = { 0, 0, 0, htonl(svc->fwmark) } .ip = htonl(svc->fwmark)
}; };
ct = ip_vs_conn_new(svc->af, IPPROTO_IP, ct = ip_vs_conn_new(svc->af, IPPROTO_IP,
......
...@@ -1186,28 +1186,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nlattr *cda[]) ...@@ -1186,28 +1186,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nlattr *cda[])
return 0; return 0;
} }
static inline void
ctnetlink_event_report(struct nf_conn *ct, u32 pid, int report)
{
unsigned int events = 0;
if (test_bit(IPS_EXPECTED_BIT, &ct->status))
events |= IPCT_RELATED;
else
events |= IPCT_NEW;
nf_conntrack_event_report(IPCT_STATUS |
IPCT_HELPER |
IPCT_REFRESH |
IPCT_PROTOINFO |
IPCT_NATSEQADJ |
IPCT_MARK |
events,
ct,
pid,
report);
}
static struct nf_conn * static struct nf_conn *
ctnetlink_create_conntrack(struct nlattr *cda[], ctnetlink_create_conntrack(struct nlattr *cda[],
struct nf_conntrack_tuple *otuple, struct nf_conntrack_tuple *otuple,
...@@ -1373,6 +1351,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, ...@@ -1373,6 +1351,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
err = -ENOENT; err = -ENOENT;
if (nlh->nlmsg_flags & NLM_F_CREATE) { if (nlh->nlmsg_flags & NLM_F_CREATE) {
struct nf_conn *ct; struct nf_conn *ct;
enum ip_conntrack_events events;
ct = ctnetlink_create_conntrack(cda, &otuple, ct = ctnetlink_create_conntrack(cda, &otuple,
&rtuple, u3); &rtuple, u3);
...@@ -1383,9 +1362,18 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, ...@@ -1383,9 +1362,18 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
err = 0; err = 0;
nf_conntrack_get(&ct->ct_general); nf_conntrack_get(&ct->ct_general);
spin_unlock_bh(&nf_conntrack_lock); spin_unlock_bh(&nf_conntrack_lock);
ctnetlink_event_report(ct, if (test_bit(IPS_EXPECTED_BIT, &ct->status))
NETLINK_CB(skb).pid, events = IPCT_RELATED;
nlmsg_report(nlh)); else
events = IPCT_NEW;
nf_conntrack_event_report(IPCT_STATUS |
IPCT_HELPER |
IPCT_PROTOINFO |
IPCT_NATSEQADJ |
IPCT_MARK | events,
ct, NETLINK_CB(skb).pid,
nlmsg_report(nlh));
nf_ct_put(ct); nf_ct_put(ct);
} else } else
spin_unlock_bh(&nf_conntrack_lock); spin_unlock_bh(&nf_conntrack_lock);
...@@ -1404,9 +1392,13 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, ...@@ -1404,9 +1392,13 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
if (err == 0) { if (err == 0) {
nf_conntrack_get(&ct->ct_general); nf_conntrack_get(&ct->ct_general);
spin_unlock_bh(&nf_conntrack_lock); spin_unlock_bh(&nf_conntrack_lock);
ctnetlink_event_report(ct, nf_conntrack_event_report(IPCT_STATUS |
NETLINK_CB(skb).pid, IPCT_HELPER |
nlmsg_report(nlh)); IPCT_PROTOINFO |
IPCT_NATSEQADJ |
IPCT_MARK,
ct, NETLINK_CB(skb).pid,
nlmsg_report(nlh));
nf_ct_put(ct); nf_ct_put(ct);
} else } else
spin_unlock_bh(&nf_conntrack_lock); spin_unlock_bh(&nf_conntrack_lock);
......
...@@ -135,7 +135,13 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par) ...@@ -135,7 +135,13 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
{ {
struct xt_cluster_match_info *info = par->matchinfo; struct xt_cluster_match_info *info = par->matchinfo;
if (info->node_mask >= (1 << info->total_nodes)) { if (info->total_nodes > XT_CLUSTER_NODES_MAX) {
printk(KERN_ERR "xt_cluster: you have exceeded the maximum "
"number of cluster nodes (%u > %u)\n",
info->total_nodes, XT_CLUSTER_NODES_MAX);
return false;
}
if (info->node_mask >= (1ULL << info->total_nodes)) {
printk(KERN_ERR "xt_cluster: this node mask cannot be " printk(KERN_ERR "xt_cluster: this node mask cannot be "
"higher than the total number of nodes\n"); "higher than the total number of nodes\n");
return false; return false;
......
...@@ -51,7 +51,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -51,7 +51,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1; u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1;
if (sch->ops == &bfifo_qdisc_ops) if (sch->ops == &bfifo_qdisc_ops)
limit *= qdisc_dev(sch)->mtu; limit *= psched_mtu(qdisc_dev(sch));
q->limit = limit; q->limit = limit;
} else { } else {
......
...@@ -149,7 +149,8 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev, ...@@ -149,7 +149,8 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev,
} }
result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg); result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg);
if (result < 0) { if (result < 0) {
dev_err(dev, "no memory to add payload in attribute\n"); dev_err(dev, "no memory to add payload (msg %p size %zu) in "
"attribute: %d\n", msg, size, result);
goto error_nla_put; goto error_nla_put;
} }
genlmsg_end(skb, genl_msg); genlmsg_end(skb, genl_msg);
...@@ -299,10 +300,10 @@ int wimax_msg(struct wimax_dev *wimax_dev, const char *pipe_name, ...@@ -299,10 +300,10 @@ int wimax_msg(struct wimax_dev *wimax_dev, const char *pipe_name,
struct sk_buff *skb; struct sk_buff *skb;
skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags); skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags);
if (skb == NULL) if (IS_ERR(skb))
goto error_msg_new; result = PTR_ERR(skb);
result = wimax_msg_send(wimax_dev, skb); else
error_msg_new: result = wimax_msg_send(wimax_dev, skb);
return result; return result;
} }
EXPORT_SYMBOL_GPL(wimax_msg); EXPORT_SYMBOL_GPL(wimax_msg);
......
...@@ -338,8 +338,21 @@ void __wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) ...@@ -338,8 +338,21 @@ void __wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)
*/ */
void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)
{ {
/*
* A driver cannot take the wimax_dev out of the
* __WIMAX_ST_NULL state unless by calling wimax_dev_add(). If
* the wimax_dev's state is still NULL, we ignore any request
* to change its state because it means it hasn't been yet
* registered.
*
* There is no need to complain about it, as routines that
* call this might be shared from different code paths that
* are called before or after wimax_dev_add() has done its
* job.
*/
mutex_lock(&wimax_dev->mutex); mutex_lock(&wimax_dev->mutex);
__wimax_state_change(wimax_dev, new_state); if (wimax_dev->state > __WIMAX_ST_NULL)
__wimax_state_change(wimax_dev, new_state);
mutex_unlock(&wimax_dev->mutex); mutex_unlock(&wimax_dev->mutex);
return; return;
} }
...@@ -376,7 +389,7 @@ EXPORT_SYMBOL_GPL(wimax_state_get); ...@@ -376,7 +389,7 @@ EXPORT_SYMBOL_GPL(wimax_state_get);
void wimax_dev_init(struct wimax_dev *wimax_dev) void wimax_dev_init(struct wimax_dev *wimax_dev)
{ {
INIT_LIST_HEAD(&wimax_dev->id_table_node); INIT_LIST_HEAD(&wimax_dev->id_table_node);
__wimax_state_set(wimax_dev, WIMAX_ST_UNINITIALIZED); __wimax_state_set(wimax_dev, __WIMAX_ST_NULL);
mutex_init(&wimax_dev->mutex); mutex_init(&wimax_dev->mutex);
mutex_init(&wimax_dev->mutex_reset); mutex_init(&wimax_dev->mutex_reset);
} }
......
...@@ -907,6 +907,7 @@ EXPORT_SYMBOL(freq_reg_info); ...@@ -907,6 +907,7 @@ EXPORT_SYMBOL(freq_reg_info);
int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
const struct ieee80211_reg_rule **reg_rule) const struct ieee80211_reg_rule **reg_rule)
{ {
assert_cfg80211_lock();
return freq_reg_info_regd(wiphy, center_freq, return freq_reg_info_regd(wiphy, center_freq,
bandwidth, reg_rule, NULL); bandwidth, reg_rule, NULL);
} }
...@@ -1133,7 +1134,8 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) ...@@ -1133,7 +1134,8 @@ static bool reg_is_world_roaming(struct wiphy *wiphy)
if (is_world_regdom(cfg80211_regdomain->alpha2) || if (is_world_regdom(cfg80211_regdomain->alpha2) ||
(wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) (wiphy->regd && is_world_regdom(wiphy->regd->alpha2)))
return true; return true;
if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && if (last_request &&
last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy->custom_regulatory) wiphy->custom_regulatory)
return true; return true;
return false; return false;
...@@ -1142,6 +1144,12 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) ...@@ -1142,6 +1144,12 @@ static bool reg_is_world_roaming(struct wiphy *wiphy)
/* Reap the advantages of previously found beacons */ /* Reap the advantages of previously found beacons */
static void reg_process_beacons(struct wiphy *wiphy) static void reg_process_beacons(struct wiphy *wiphy)
{ {
/*
* Means we are just firing up cfg80211, so no beacons would
* have been processed yet.
*/
if (!last_request)
return;
if (!reg_is_world_roaming(wiphy)) if (!reg_is_world_roaming(wiphy))
return; return;
wiphy_update_beacon_reg(wiphy); wiphy_update_beacon_reg(wiphy);
...@@ -1176,6 +1184,8 @@ static void handle_channel_custom(struct wiphy *wiphy, ...@@ -1176,6 +1184,8 @@ static void handle_channel_custom(struct wiphy *wiphy,
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan; struct ieee80211_channel *chan;
assert_cfg80211_lock();
sband = wiphy->bands[band]; sband = wiphy->bands[band];
BUG_ON(chan_idx >= sband->n_channels); BUG_ON(chan_idx >= sband->n_channels);
chan = &sband->channels[chan_idx]; chan = &sband->channels[chan_idx];
...@@ -1214,10 +1224,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, ...@@ -1214,10 +1224,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
const struct ieee80211_regdomain *regd) const struct ieee80211_regdomain *regd)
{ {
enum ieee80211_band band; enum ieee80211_band band;
mutex_lock(&cfg80211_mutex);
for (band = 0; band < IEEE80211_NUM_BANDS; band++) { for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (wiphy->bands[band]) if (wiphy->bands[band])
handle_band_custom(wiphy, band, regd); handle_band_custom(wiphy, band, regd);
} }
mutex_unlock(&cfg80211_mutex);
} }
EXPORT_SYMBOL(wiphy_apply_custom_regulatory); EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
...@@ -1423,7 +1436,7 @@ static int __regulatory_hint(struct wiphy *wiphy, ...@@ -1423,7 +1436,7 @@ static int __regulatory_hint(struct wiphy *wiphy,
return call_crda(last_request->alpha2); return call_crda(last_request->alpha2);
} }
/* This currently only processes user and driver regulatory hints */ /* This processes *all* regulatory hints */
static void reg_process_hint(struct regulatory_request *reg_request) static void reg_process_hint(struct regulatory_request *reg_request)
{ {
int r = 0; int r = 0;
......
...@@ -395,6 +395,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, ...@@ -395,6 +395,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
memcpy(ies, res->pub.information_elements, ielen); memcpy(ies, res->pub.information_elements, ielen);
found->ies_allocated = true; found->ies_allocated = true;
found->pub.information_elements = ies; found->pub.information_elements = ies;
found->pub.len_information_elements = ielen;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册