Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Pull networking updates from David Miller:

 1) inet6_csk_update_pmtu() must return NULL or non-NULL, so translate
    ERR_PTR to NULL, as needed.  Fix from Eric Dumazet.

 2) Fix copy&paste error in IRDA sir_dev ->set_speed method invocation,
    it was testing the NULL'ness of a different method to guard the
    call.  Fix from Alexander Shiyan.

 3) Fix build regression of xilinx driver, from Jeff Mahoney.

 4) Make XEN netfront (like XEN netback) handle compound pages in SKBs
    properly.  From Ian Campbell.

 5) Fix inverted logic of team_dev_queue_xmit() return value checks,
    from Jiri Pirko and Dan Carpenter.

 6) dma_poll_create() no longer allows a NULL device argument, breaking
    both ixp4xx drivers.  Fix from Xi Wang.

 7) ne2000 driver doesn't hook up the parent device properly, breaking
    udev matching.  Fix from Alan Cox.

 8) Locking and memory leak fixes in Near Field Communications layer.
    From Thierry Escande, Szymon Janc, and Waldemar Rymarkiewicz.

 9) sis900 resume regression, sis900_set_mode() is being called with the
    iomem pointer instead of the expected device private.  Fix from
    Francois Romieu.

10) Fix IBSS regression caused by uninitializing the ibss-internals
    before performing an emptyness check, from Simon WUnderlich.

11) Fix SNIFFER mode regression in iwlwifi driver, from Johannes Berg.

12) Fix task wedges in mwifiex_cmd_timeout_func(), from Bing Zhao.

13) Add back wireless sysfs directory, too much stuff depends upon it
    being there (actually I'd say it never should have been removed to
    begin with).  From Johannes Berg.

14) Fix hang introduced by suspend/resume changes in ath9k.  Fix from
    Sujith Manoharan.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (24 commits)
  team: bcast: convert return value of team_dev_queue_xmit() to bool correctly
  bonding: Bonding driver does not consider the gso_max_size/gso_max_segs setting of slave devices.
  xen/netfront: handle compound page fragments on transmit
  net: fix build failure in xilinx
  irda: sir_dev: Fix copy/paste typo
  ipv6: fix inet6_csk_update_pmtu() return value
  ixp4xx_hss: avoid calling dma_pool_create() with NULL dev
  ixp4xx_eth: avoid calling dma_pool_create() with NULL dev
  ne2000: add the right platform device
  of/net/mdio-gpio: Fix pdev->id issue when using devicetrees.
  NFC: Fix pn533 target mode memory leak
  NFC: pn533: Fix mem leak in pn533_in_dep_link_up
  NFC: pn533: Fix use after free
  NFC: pn533: Fix missing lock while operating on commands list
  NFC: Fix nfc_llcp_local chained list insertion
  ath9k_hw: Fix regression in device reset
  sis900: fix sis900_set_mode call parameters.
  iwlwifi: don't WARN when a non empty queue is disabled
  wireless: add back sysfs directory
  mwifiex: report error to MMC core if we cannot suspend
  ...
  • Loading branch information
Linus Torvalds committed Nov 21, 2012
2 parents 45e7715 + 403f43c commit db9d8c6
Show file tree
Hide file tree
Showing 22 changed files with 188 additions and 71 deletions.
9 changes: 8 additions & 1 deletion Documentation/devicetree/bindings/net/mdio-gpio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ gpios property as described in section VIII.1 in the following order:

MDC, MDIO.

Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
node.

Example:

mdio {
aliases {
mdio-gpio0 = <&mdio0>;
};

mdio0: mdio {
compatible = "virtual,mdio-gpio";
#address-cells = <1>;
#size-cells = <0>;
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,8 @@ static void bond_compute_features(struct bonding *bond)
struct net_device *bond_dev = bond->dev;
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int gso_max_size = GSO_MAX_SIZE;
u16 gso_max_segs = GSO_MAX_SEGS;
int i;
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;

Expand All @@ -1394,11 +1396,16 @@ static void bond_compute_features(struct bonding *bond)
dst_release_flag &= slave->dev->priv_flags;
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;

gso_max_size = min(gso_max_size, slave->dev->gso_max_size);
gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs);
}

done:
bond_dev->vlan_features = vlan_features;
bond_dev->hard_header_len = max_hard_header_len;
bond_dev->gso_max_segs = gso_max_segs;
netif_set_gso_max_size(bond_dev, gso_max_size);

flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
bond_dev->priv_flags = flags | dst_release_flag;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/8390/ne.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)
dev->irq = irq[this_dev];
dev->mem_end = bad[this_dev];
}
SET_NETDEV_DEV(dev, &pdev->dev);
err = do_ne_probe(dev);
if (err) {
free_netdev(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sis/sis900.c
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev)
netif_start_queue(net_dev);

/* Workaround for EDB */
sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);

/* Enable all known interrupts by setting the interrupt mask. */
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,8 @@ static irqreturn_t axienet_rx_irq(int irq, void *_ndev)
return IRQ_HANDLED;
}

static void axienet_dma_err_handler(unsigned long data);

/**
* axienet_open - Driver open routine.
* @ndev: Pointer to net_device structure
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/ethernet/xscale/ixp4xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,10 +1102,12 @@ static int init_queues(struct port *port)
{
int i;

if (!ports_open)
if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
POOL_ALLOC_SIZE, 32, 0)))
if (!ports_open) {
dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
POOL_ALLOC_SIZE, 32, 0);
if (!dma_pool)
return -ENOMEM;
}

if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
&port->desc_tab_phys)))
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/sir_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static void sirdev_config_fsm(struct work_struct *work)
break;

case SIRDEV_STATE_DONGLE_SPEED:
if (dev->dongle_drv->reset) {
if (dev->dongle_drv->set_speed) {
ret = dev->dongle_drv->set_speed(dev, fsm->param);
if (ret < 0) {
fsm->result = ret;
Expand Down
11 changes: 7 additions & 4 deletions drivers/net/phy/mdio-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,20 @@ static int __devinit mdio_gpio_probe(struct platform_device *pdev)
{
struct mdio_gpio_platform_data *pdata;
struct mii_bus *new_bus;
int ret;
int ret, bus_id;

if (pdev->dev.of_node)
if (pdev->dev.of_node) {
pdata = mdio_gpio_of_get_data(pdev);
else
bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio");
} else {
pdata = pdev->dev.platform_data;
bus_id = pdev->id;
}

if (!pdata)
return -ENODEV;

new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, bus_id);
if (!new_bus)
return -ENODEV;

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/team/team_mode_broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)
if (last) {
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2) {
ret = team_dev_queue_xmit(team, last,
skb2);
ret = !team_dev_queue_xmit(team, last,
skb2);
if (!sum_ret)
sum_ret = ret;
}
Expand All @@ -39,7 +39,7 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)
}
}
if (last) {
ret = team_dev_queue_xmit(team, last, skb);
ret = !team_dev_queue_xmit(team, last, skb);
if (!sum_ret)
sum_ret = ret;
}
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/wan/ixp4xx_hss.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port)
{
int i;

if (!ports_open)
if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
POOL_ALLOC_SIZE, 32, 0)))
if (!ports_open) {
dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
POOL_ALLOC_SIZE, 32, 0);
if (!dma_pool)
return -ENOMEM;
}

if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
&port->desc_tab_phys)))
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
switch (type) {
case ATH9K_RESET_POWER_ON:
ret = ath9k_hw_set_reset_power_on(ah);
if (!ret)
if (ret)
ah->reset_power_on = true;
break;
case ATH9K_RESET_WARM:
Expand Down
14 changes: 14 additions & 0 deletions drivers/net/wireless/iwlwifi/dvm/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,20 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
vif_priv->ctx = ctx;
ctx->vif = vif;

/*
* In SNIFFER device type, the firmware reports the FCS to
* the host, rather than snipping it off. Unfortunately,
* mac80211 doesn't (yet) provide a per-packet flag for
* this, so that we have to set the hardware flag based
* on the interfaces added. As the monitor interface can
* only be present by itself, and will be removed before
* other interfaces are added, this is safe.
*/
if (vif->type == NL80211_IFTYPE_MONITOR)
priv->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
else
priv->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;

err = iwl_setup_interface(priv, ctx);
if (!err || reset)
goto out;
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/wireless/iwlwifi/pcie/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,20 +480,12 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
u16 rd_ptr, wr_ptr;
int n_bd = trans_pcie->txq[txq_id].q.n_bd;

if (!test_and_clear_bit(txq_id, trans_pcie->queue_used)) {
WARN_ONCE(1, "queue %d not used", txq_id);
return;
}

rd_ptr = iwl_read_prph(trans, SCD_QUEUE_RDPTR(txq_id)) & (n_bd - 1);
wr_ptr = iwl_read_prph(trans, SCD_QUEUE_WRPTR(txq_id));

WARN_ONCE(rd_ptr != wr_ptr, "queue %d isn't empty: [%d,%d]",
txq_id, rd_ptr, wr_ptr);

iwl_txq_set_inactive(trans, txq_id);
IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", txq_id);
}
Expand Down
11 changes: 8 additions & 3 deletions drivers/net/wireless/mwifiex/cmdevt.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
return;
}
cmd_node = adapter->curr_cmd;
if (cmd_node->wait_q_enabled)
adapter->cmd_wait_q.status = -ETIMEDOUT;

if (cmd_node) {
adapter->dbg.timeout_cmd_id =
adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index];
Expand Down Expand Up @@ -938,6 +935,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context)

dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
adapter->ps_mode, adapter->ps_state);

if (cmd_node->wait_q_enabled) {
adapter->cmd_wait_q.status = -ETIMEDOUT;
wake_up_interruptible(&adapter->cmd_wait_q.wait);
mwifiex_cancel_pending_ioctl(adapter);
/* reset cmd_sent flag to unblock new commands */
adapter->cmd_sent = false;
}
}
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
mwifiex_init_fw_complete(adapter);
Expand Down
11 changes: 6 additions & 5 deletions drivers/net/wireless/mwifiex/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ static int mwifiex_sdio_suspend(struct device *dev)
struct sdio_mmc_card *card;
struct mwifiex_adapter *adapter;
mmc_pm_flag_t pm_flag = 0;
int hs_actived = 0;
int i;
int ret = 0;

Expand All @@ -188,12 +187,14 @@ static int mwifiex_sdio_suspend(struct device *dev)
adapter = card->adapter;

/* Enable the Host Sleep */
hs_actived = mwifiex_enable_hs(adapter);
if (hs_actived) {
pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n");
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
if (!mwifiex_enable_hs(adapter)) {
dev_err(adapter->dev, "cmd: failed to suspend\n");
return -EFAULT;
}

dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n");
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);

/* Indicate device suspended */
adapter->is_suspended = true;

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
/*=== Customer ID ===*/
/****** 8188CU ********/
{RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/
{RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/
{RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
Expand Down
98 changes: 77 additions & 21 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
/* Grant backend access to each skb fragment page. */
for (i = 0; i < frags; i++) {
skb_frag_t *frag = skb_shinfo(skb)->frags + i;
struct page *page = skb_frag_page(frag);

tx->flags |= XEN_NETTXF_more_data;
len = skb_frag_size(frag);
offset = frag->page_offset;

id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
np->tx_skbs[id].skb = skb_get(skb);
tx = RING_GET_REQUEST(&np->tx, prod++);
tx->id = id;
ref = gnttab_claim_grant_reference(&np->gref_tx_head);
BUG_ON((signed short)ref < 0);
/* Data must not cross a page boundary. */
BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));

mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
mfn, GNTMAP_readonly);
/* Skip unused frames from start of page */
page += offset >> PAGE_SHIFT;
offset &= ~PAGE_MASK;

tx->gref = np->grant_tx_ref[id] = ref;
tx->offset = frag->page_offset;
tx->size = skb_frag_size(frag);
tx->flags = 0;
while (len > 0) {
unsigned long bytes;

BUG_ON(offset >= PAGE_SIZE);

bytes = PAGE_SIZE - offset;
if (bytes > len)
bytes = len;

tx->flags |= XEN_NETTXF_more_data;

id = get_id_from_freelist(&np->tx_skb_freelist,
np->tx_skbs);
np->tx_skbs[id].skb = skb_get(skb);
tx = RING_GET_REQUEST(&np->tx, prod++);
tx->id = id;
ref = gnttab_claim_grant_reference(&np->gref_tx_head);
BUG_ON((signed short)ref < 0);

mfn = pfn_to_mfn(page_to_pfn(page));
gnttab_grant_foreign_access_ref(ref,
np->xbdev->otherend_id,
mfn, GNTMAP_readonly);

tx->gref = np->grant_tx_ref[id] = ref;
tx->offset = offset;
tx->size = bytes;
tx->flags = 0;

offset += bytes;
len -= bytes;

/* Next frame */
if (offset == PAGE_SIZE && len) {
BUG_ON(!PageCompound(page));
page++;
offset = 0;
}
}
}

np->tx.req_prod_pvt = prod;
}

/*
* Count how many ring slots are required to send the frags of this
* skb. Each frag might be a compound page.
*/
static int xennet_count_skb_frag_slots(struct sk_buff *skb)
{
int i, frags = skb_shinfo(skb)->nr_frags;
int pages = 0;

for (i = 0; i < frags; i++) {
skb_frag_t *frag = skb_shinfo(skb)->frags + i;
unsigned long size = skb_frag_size(frag);
unsigned long offset = frag->page_offset;

/* Skip unused frames from start of page */
offset &= ~PAGE_MASK;

pages += PFN_UP(offset + size);
}

return pages;
}

static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
unsigned short id;
Expand All @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
grant_ref_t ref;
unsigned long mfn;
int notify;
int frags = skb_shinfo(skb)->nr_frags;
int slots;
unsigned int offset = offset_in_page(data);
unsigned int len = skb_headlen(skb);
unsigned long flags;

frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
frags);
dump_stack();
slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
xennet_count_skb_frag_slots(skb);
if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
net_alert_ratelimited(
"xennet: skb rides the rocket: %d slots\n", slots);
goto drop;
}

spin_lock_irqsave(&np->tx_lock, flags);

if (unlikely(!netif_carrier_ok(dev) ||
(frags > 1 && !xennet_can_sg(dev)) ||
(slots > 1 && !xennet_can_sg(dev)) ||
netif_needs_gso(skb, netif_skb_features(skb)))) {
spin_unlock_irqrestore(&np->tx_lock, flags);
goto drop;
Expand Down
Loading

0 comments on commit db9d8c6

Please sign in to comment.