From 7c168d09be7ef8b51cd1b852a401ece7f889d360 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Tue, 15 Sep 2009 17:54:43 +0400 Subject: [PATCH] --- yaml --- r: 162913 b: refs/heads/master c: 066fc51275cef94d1624fd58bb3065d050a6f17e h: refs/heads/master i: 162911: 3d3cf267fcff41cf0ab3292d3fe733bd3c98f13d v: v3 --- [refs] | 2 +- trunk/drivers/net/b44.c | 7 +- trunk/drivers/net/bonding/bond_main.c | 131 ++- trunk/drivers/net/can/vcan.c | 2 +- trunk/drivers/net/igb/e1000_82575.c | 198 ++-- trunk/drivers/net/igb/e1000_82575.h | 2 +- trunk/drivers/net/igb/e1000_defines.h | 2 +- trunk/drivers/net/igb/e1000_phy.c | 5 +- trunk/drivers/net/igb/igb_main.c | 2 +- trunk/drivers/net/ixgbe/ixgbe_82598.c | 6 +- trunk/drivers/net/ixgbe/ixgbe_82599.c | 3 - trunk/drivers/net/ixgbe/ixgbe_main.c | 4 - trunk/drivers/net/ixgbe/ixgbe_type.h | 2 - trunk/drivers/net/mlx4/catas.c | 11 +- trunk/drivers/net/pcmcia/pcnet_cs.c | 10 +- trunk/drivers/net/pppol2tp.c | 4 +- trunk/drivers/net/sky2.c | 24 +- trunk/drivers/net/smc91x.h | 28 + trunk/drivers/net/usb/cdc-phonet.c | 1 + trunk/drivers/net/wireless/Kconfig | 1 - trunk/drivers/net/wireless/ath/ath9k/ani.c | 6 +- trunk/drivers/net/wireless/b43/main.c | 8 +- .../drivers/net/wireless/hostap/hostap_main.c | 3 +- trunk/drivers/net/wireless/iwlwifi/iwl-4965.c | 1 - .../drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 10 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.c | 9 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.h | 1 - .../drivers/net/wireless/iwlwifi/iwl-power.c | 5 +- trunk/drivers/net/wireless/iwlwifi/iwl-rx.c | 24 +- .../net/wireless/iwlwifi/iwl3945-base.c | 24 +- trunk/drivers/net/wireless/p54/p54usb.c | 1 - .../drivers/net/wireless/wl12xx/wl1271_main.c | 3 +- trunk/drivers/serial/serial_cs.c | 14 +- trunk/drivers/ssb/pci.c | 1 - trunk/drivers/ssb/sdio.c | 6 +- trunk/firmware/Makefile | 3 +- trunk/firmware/WHENCE | 12 - trunk/firmware/cis/MT5634ZLX.cis.ihex | 11 - trunk/firmware/cis/PCMLM28.cis.ihex | 18 - trunk/firmware/cis/RS-COM-2P.cis.ihex | 10 - trunk/include/keys/rxrpc-type.h | 107 -- trunk/include/linux/igmp.h | 2 - trunk/include/linux/net.h | 5 - trunk/include/linux/netdevice.h | 3 +- trunk/include/linux/netlink.h | 4 - trunk/include/linux/notifier.h | 2 - trunk/include/linux/rxrpc.h | 7 - trunk/include/net/addrconf.h | 2 - trunk/include/net/protocol.h | 13 +- trunk/include/net/sch_generic.h | 2 +- trunk/include/net/tcp.h | 7 - trunk/net/appletalk/ddp.c | 2 +- trunk/net/can/af_can.c | 4 +- trunk/net/core/dev.c | 4 +- trunk/net/dccp/ccids/Kconfig | 6 +- trunk/net/dccp/ccids/ccid2.c | 2 + trunk/net/dccp/ccids/ccid2.h | 8 +- trunk/net/dccp/ccids/ccid3.c | 5 +- trunk/net/dccp/ccids/ccid3.h | 50 +- trunk/net/dccp/ccids/lib/loss_interval.c | 7 +- trunk/net/dccp/ccids/lib/loss_interval.h | 2 + trunk/net/dccp/ccids/lib/packet_history.c | 4 +- trunk/net/dccp/ccids/lib/packet_history.h | 1 + trunk/net/dccp/ccids/lib/tfrc.h | 4 +- trunk/net/dccp/ccids/lib/tfrc_equation.c | 26 +- trunk/net/dccp/ipv4.c | 2 +- trunk/net/dccp/ipv6.c | 4 +- trunk/net/ieee802154/dgram.c | 2 +- trunk/net/ieee802154/raw.c | 2 +- trunk/net/ipv4/af_inet.c | 18 +- trunk/net/ipv4/ah4.c | 2 +- trunk/net/ipv4/devinet.c | 6 - trunk/net/ipv4/esp4.c | 2 +- trunk/net/ipv4/icmp.c | 2 +- trunk/net/ipv4/igmp.c | 22 - trunk/net/ipv4/ip_gre.c | 2 +- trunk/net/ipv4/ip_input.c | 2 +- trunk/net/ipv4/ipcomp.c | 2 +- trunk/net/ipv4/ipmr.c | 6 +- trunk/net/ipv4/protocol.c | 6 +- trunk/net/ipv4/tcp.c | 2 +- trunk/net/ipv4/tcp_input.c | 2 +- trunk/net/ipv4/tcp_ipv4.c | 4 +- trunk/net/ipv4/tcp_minisocks.c | 4 +- trunk/net/ipv4/tunnel4.c | 4 +- trunk/net/ipv4/udplite.c | 2 +- trunk/net/ipv6/addrconf.c | 19 - trunk/net/ipv6/af_inet6.c | 10 +- trunk/net/ipv6/ah6.c | 2 +- trunk/net/ipv6/esp6.c | 2 +- trunk/net/ipv6/exthdrs.c | 6 +- trunk/net/ipv6/icmp.c | 4 +- trunk/net/ipv6/ip6_input.c | 2 +- trunk/net/ipv6/ip6mr.c | 6 +- trunk/net/ipv6/ipcomp6.c | 2 +- trunk/net/ipv6/mcast.c | 19 - trunk/net/ipv6/protocol.c | 6 +- trunk/net/ipv6/reassembly.c | 2 +- trunk/net/ipv6/route.c | 2 +- trunk/net/ipv6/tcp_ipv6.c | 7 +- trunk/net/ipv6/tunnel6.c | 4 +- trunk/net/ipv6/udp.c | 2 +- trunk/net/ipv6/udplite.c | 2 +- trunk/net/iucv/af_iucv.c | 4 +- trunk/net/mac80211/rc80211_minstrel.c | 2 +- trunk/net/netlink/af_netlink.c | 51 +- trunk/net/netlink/genetlink.c | 5 +- trunk/net/phonet/pn_dev.c | 9 +- trunk/net/rds/af_rds.c | 2 +- trunk/net/rose/af_rose.c | 4 +- trunk/net/rxrpc/ar-ack.c | 6 +- trunk/net/rxrpc/ar-internal.h | 32 +- trunk/net/rxrpc/ar-key.c | 914 +----------------- trunk/net/rxrpc/ar-security.c | 8 +- trunk/net/rxrpc/rxkad.c | 47 +- trunk/net/sched/sch_api.c | 29 +- trunk/net/sched/sch_mq.c | 13 +- trunk/net/sctp/ipv6.c | 2 +- trunk/net/sctp/protocol.c | 2 +- trunk/net/socket.c | 1 - trunk/net/wireless/scan.c | 7 +- trunk/net/wireless/sme.c | 21 +- 122 files changed, 591 insertions(+), 1657 deletions(-) delete mode 100644 trunk/firmware/cis/MT5634ZLX.cis.ihex delete mode 100644 trunk/firmware/cis/PCMLM28.cis.ihex delete mode 100644 trunk/firmware/cis/RS-COM-2P.cis.ihex diff --git a/[refs] b/[refs] index 62a11d2275b8..0c84e3598c7b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0aad191c5fea3627c8efbc453cfebb6d1dca496c +refs/heads/master: 066fc51275cef94d1624fd58bb3065d050a6f17e diff --git a/trunk/drivers/net/b44.c b/trunk/drivers/net/b44.c index e046943ef29d..0189dcd36f31 100644 --- a/trunk/drivers/net/b44.c +++ b/trunk/drivers/net/b44.c @@ -847,22 +847,23 @@ static int b44_poll(struct napi_struct *napi, int budget) { struct b44 *bp = container_of(napi, struct b44, napi); int work_done; - unsigned long flags; - spin_lock_irqsave(&bp->lock, flags); + spin_lock_irq(&bp->lock); if (bp->istat & (ISTAT_TX | ISTAT_TO)) { /* spin_lock(&bp->tx_lock); */ b44_tx(bp); /* spin_unlock(&bp->tx_lock); */ } - spin_unlock_irqrestore(&bp->lock, flags); + spin_unlock_irq(&bp->lock); work_done = 0; if (bp->istat & ISTAT_RX) work_done += b44_rx(bp, budget); if (bp->istat & ISTAT_ERRORS) { + unsigned long flags; + spin_lock_irqsave(&bp->lock, flags); b44_halt(bp); b44_init_rings(bp); diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 69c5b15e22da..a7e731f8a0da 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -1093,8 +1093,15 @@ static struct slave *bond_find_best_slave(struct bonding *bond) return NULL; /* still no slave, return NULL */ } + /* + * first try the primary link; if arping, a link must tx/rx + * traffic before it can be considered the curr_active_slave. + * also, we would skip slaves between the curr_active_slave + * and primary_slave that may be up and able to arp + */ if ((bond->primary_slave) && - bond->primary_slave->link == BOND_LINK_UP) { + (!bond->params.arp_interval) && + (IS_UP(bond->primary_slave->dev))) { new_active = bond->primary_slave; } @@ -1102,14 +1109,15 @@ static struct slave *bond_find_best_slave(struct bonding *bond) old_active = new_active; bond_for_each_slave_from(bond, new_active, i, old_active) { - if (new_active->link == BOND_LINK_UP) { - return new_active; - } else if (new_active->link == BOND_LINK_BACK && - IS_UP(new_active->dev)) { - /* link up, but waiting for stabilization */ - if (new_active->delay < mintime) { - mintime = new_active->delay; - bestslave = new_active; + if (IS_UP(new_active->dev)) { + if (new_active->link == BOND_LINK_UP) { + return new_active; + } else if (new_active->link == BOND_LINK_BACK) { + /* link up, but waiting for stabilization */ + if (new_active->delay < mintime) { + mintime = new_active->delay; + bestslave = new_active; + } } } } @@ -1203,7 +1211,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) write_unlock_bh(&bond->curr_slave_lock); read_unlock(&bond->lock); - netdev_bonding_change(bond->dev, NETDEV_BONDING_FAILOVER); + netdev_bonding_change(bond->dev); read_lock(&bond->lock); write_lock_bh(&bond->curr_slave_lock); @@ -1461,17 +1469,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) */ if (bond->slave_cnt == 0) { if (bond_dev->type != slave_dev->type) { + dev_close(bond_dev); pr_debug("%s: change device type from %d to %d\n", bond_dev->name, bond_dev->type, slave_dev->type); - - netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); - if (slave_dev->type != ARPHRD_ETHER) bond_setup_by_slave(bond_dev, slave_dev); else ether_setup(bond_dev); - - netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); + dev_open(bond_dev); } } else if (bond_dev->type != slave_dev->type) { pr_err(DRV_NAME ": %s ether type (%d) is different " @@ -2924,6 +2929,18 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks) } } + read_lock(&bond->curr_slave_lock); + + /* + * Trigger a commit if the primary option setting has changed. + */ + if (bond->primary_slave && + (bond->primary_slave != bond->curr_active_slave) && + (bond->primary_slave->link == BOND_LINK_UP)) + commit++; + + read_unlock(&bond->curr_slave_lock); + return commit; } @@ -2944,58 +2961,90 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) continue; case BOND_LINK_UP: - if ((!bond->curr_active_slave && - time_before_eq(jiffies, - dev_trans_start(slave->dev) + - delta_in_ticks)) || - bond->curr_active_slave != slave) { + write_lock_bh(&bond->curr_slave_lock); + + if (!bond->curr_active_slave && + time_before_eq(jiffies, dev_trans_start(slave->dev) + + delta_in_ticks)) { slave->link = BOND_LINK_UP; + bond_change_active_slave(bond, slave); bond->current_arp_slave = NULL; pr_info(DRV_NAME - ": %s: link status definitely " - "up for interface %s.\n", - bond->dev->name, slave->dev->name); - - if (!bond->curr_active_slave || - (slave == bond->primary_slave)) - goto do_failover; + ": %s: %s is up and now the " + "active interface\n", + bond->dev->name, slave->dev->name); + + } else if (bond->curr_active_slave != slave) { + /* this slave has just come up but we + * already have a current slave; this can + * also happen if bond_enslave adds a new + * slave that is up while we are searching + * for a new slave + */ + slave->link = BOND_LINK_UP; + bond_set_slave_inactive_flags(slave); + bond->current_arp_slave = NULL; + pr_info(DRV_NAME + ": %s: backup interface %s is now up\n", + bond->dev->name, slave->dev->name); } - continue; + write_unlock_bh(&bond->curr_slave_lock); + + break; case BOND_LINK_DOWN: if (slave->link_failure_count < UINT_MAX) slave->link_failure_count++; slave->link = BOND_LINK_DOWN; - bond_set_slave_inactive_flags(slave); - - pr_info(DRV_NAME - ": %s: link status definitely down for " - "interface %s, disabling it\n", - bond->dev->name, slave->dev->name); if (slave == bond->curr_active_slave) { + pr_info(DRV_NAME + ": %s: link status down for active " + "interface %s, disabling it\n", + bond->dev->name, slave->dev->name); + + bond_set_slave_inactive_flags(slave); + + write_lock_bh(&bond->curr_slave_lock); + + bond_select_active_slave(bond); + if (bond->curr_active_slave) + bond->curr_active_slave->jiffies = + jiffies; + + write_unlock_bh(&bond->curr_slave_lock); + bond->current_arp_slave = NULL; - goto do_failover; - } - continue; + } else if (slave->state == BOND_STATE_BACKUP) { + pr_info(DRV_NAME + ": %s: backup interface %s is now down\n", + bond->dev->name, slave->dev->name); + + bond_set_slave_inactive_flags(slave); + } + break; default: pr_err(DRV_NAME ": %s: impossible: new_link %d on slave %s\n", bond->dev->name, slave->new_link, slave->dev->name); - continue; } + } -do_failover: - ASSERT_RTNL(); + /* + * No race with changes to primary via sysfs, as we hold rtnl. + */ + if (bond->primary_slave && + (bond->primary_slave != bond->curr_active_slave) && + (bond->primary_slave->link == BOND_LINK_UP)) { write_lock_bh(&bond->curr_slave_lock); - bond_select_active_slave(bond); + bond_change_active_slave(bond, bond->primary_slave); write_unlock_bh(&bond->curr_slave_lock); } diff --git a/trunk/drivers/net/can/vcan.c b/trunk/drivers/net/can/vcan.c index 80ac56313981..6971f6cd37fa 100644 --- a/trunk/drivers/net/can/vcan.c +++ b/trunk/drivers/net/can/vcan.c @@ -80,7 +80,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev) skb->dev = dev; skb->ip_summed = CHECKSUM_UNNECESSARY; - netif_rx_ni(skb); + netif_rx(skb); } static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev) diff --git a/trunk/drivers/net/igb/e1000_82575.c b/trunk/drivers/net/igb/e1000_82575.c index f8f5772557ce..6158c0f3b205 100644 --- a/trunk/drivers/net/igb/e1000_82575.c +++ b/trunk/drivers/net/igb/e1000_82575.c @@ -49,10 +49,11 @@ static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *, u32, u16 *); static s32 igb_reset_hw_82575(struct e1000_hw *); static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *, bool); static s32 igb_setup_copper_link_82575(struct e1000_hw *); -static s32 igb_setup_serdes_link_82575(struct e1000_hw *); +static s32 igb_setup_fiber_serdes_link_82575(struct e1000_hw *); static s32 igb_write_phy_reg_sgmii_82575(struct e1000_hw *, u32, u16); static void igb_clear_hw_cntrs_82575(struct e1000_hw *); static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *, u16); +static void igb_configure_pcs_link_82575(struct e1000_hw *); static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *, u16 *, u16 *); static s32 igb_get_phy_id_82575(struct e1000_hw *); @@ -104,20 +105,16 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) dev_spec->sgmii_active = false; ctrl_ext = rd32(E1000_CTRL_EXT); - switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) { - case E1000_CTRL_EXT_LINK_MODE_SGMII: - dev_spec->sgmii_active = true; - ctrl_ext |= E1000_CTRL_I2C_ENA; - break; - case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: + if ((ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) == + E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES) { hw->phy.media_type = e1000_media_type_internal_serdes; ctrl_ext |= E1000_CTRL_I2C_ENA; - break; - default: + } else if (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_SGMII) { + dev_spec->sgmii_active = true; + ctrl_ext |= E1000_CTRL_I2C_ENA; + } else { ctrl_ext &= ~E1000_CTRL_I2C_ENA; - break; } - wr32(E1000_CTRL_EXT, ctrl_ext); /* Set mta register count */ @@ -137,7 +134,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) mac->ops.setup_physical_interface = (hw->phy.media_type == e1000_media_type_copper) ? igb_setup_copper_link_82575 - : igb_setup_serdes_link_82575; + : igb_setup_fiber_serdes_link_82575; /* NVM initialization */ eecd = rd32(E1000_EECD); @@ -382,7 +379,6 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw) struct e1000_phy_info *phy = &hw->phy; s32 ret_val = 0; u16 phy_id; - u32 ctrl_ext; /* * For SGMII PHYs, we try the list of possible addresses until @@ -397,12 +393,6 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw) goto out; } - /* Power on sgmii phy if it is disabled */ - ctrl_ext = rd32(E1000_CTRL_EXT); - wr32(E1000_CTRL_EXT, ctrl_ext & ~E1000_CTRL_EXT_SDP3_DATA); - wrfl(); - msleep(300); - /* * The address field in the I2CCMD register is 3 bits and 0 is invalid. * Therefore, we need to test 1-7 @@ -428,12 +418,9 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw) phy->addr = 0; ret_val = -E1000_ERR_PHY; goto out; - } else { - ret_val = igb_get_phy_id(hw); } - /* restore previous sfp cage power state */ - wr32(E1000_CTRL_EXT, ctrl_ext); + ret_val = igb_get_phy_id(hw); out: return ret_val; @@ -779,18 +766,17 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, } /** - * igb_shutdown_serdes_link_82575 - Remove link during power down + * igb_shutdown_fiber_serdes_link_82575 - Remove link during power down * @hw: pointer to the HW structure * * In the case of fiber serdes, shut down optics and PCS on driver unload * when management pass thru is not enabled. **/ -void igb_shutdown_serdes_link_82575(struct e1000_hw *hw) +void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw) { u32 reg; - if (hw->phy.media_type != e1000_media_type_internal_serdes || - igb_sgmii_active_82575(hw)) + if (hw->phy.media_type != e1000_media_type_internal_serdes) return; /* if the management interface is not enabled, then power down */ @@ -802,7 +788,7 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw) /* shutdown the laser */ reg = rd32(E1000_CTRL_EXT); - reg |= E1000_CTRL_EXT_SDP3_DATA; + reg |= E1000_CTRL_EXT_SDP7_DATA; wr32(E1000_CTRL_EXT, reg); /* flush the write to verify completion */ @@ -941,17 +927,6 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); wr32(E1000_CTRL, ctrl); - ret_val = igb_setup_serdes_link_82575(hw); - if (ret_val) - goto out; - - if (igb_sgmii_active_82575(hw) && !hw->phy.reset_disable) { - ret_val = hw->phy.ops.reset(hw); - if (ret_val) { - hw_dbg("Error resetting the PHY.\n"); - goto out; - } - } switch (hw->phy.type) { case e1000_phy_m88: ret_val = igb_copper_link_setup_m88(hw); @@ -988,6 +963,8 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) } } + igb_configure_pcs_link_82575(hw); + /* * Check link status. Wait up to 100 microseconds for link to become * valid. @@ -1010,18 +987,14 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) } /** - * igb_setup_serdes_link_82575 - Setup link for fiber/serdes + * igb_setup_fiber_serdes_link_82575 - Setup link for fiber/serdes * @hw: pointer to the HW structure * * Configures speed and duplex for fiber and serdes links. **/ -static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) +static s32 igb_setup_fiber_serdes_link_82575(struct e1000_hw *hw) { - u32 ctrl_reg, reg; - - if ((hw->phy.media_type != e1000_media_type_internal_serdes) && - !igb_sgmii_active_82575(hw)) - return 0; + u32 reg; /* * On the 82575, SerDes loopback mode persists until it is @@ -1031,38 +1004,26 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) */ wr32(E1000_SCTL, E1000_SCTL_DISABLE_SERDES_LOOPBACK); - /* power on the sfp cage if present */ - reg = rd32(E1000_CTRL_EXT); - reg &= ~E1000_CTRL_EXT_SDP3_DATA; - wr32(E1000_CTRL_EXT, reg); - - ctrl_reg = rd32(E1000_CTRL); - ctrl_reg |= E1000_CTRL_SLU; - - if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { - /* set both sw defined pins */ - ctrl_reg |= E1000_CTRL_SWDPIN0 | E1000_CTRL_SWDPIN1; - - /* Set switch control to serdes energy detect */ - reg = rd32(E1000_CONNSW); - reg |= E1000_CONNSW_ENRGSRC; - wr32(E1000_CONNSW, reg); - } - - reg = rd32(E1000_PCS_LCTL); - - if (igb_sgmii_active_82575(hw)) { - /* allow time for SFP cage to power up phy */ - msleep(300); - - /* AN time out should be disabled for SGMII mode */ - reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT); - } else { - ctrl_reg |= E1000_CTRL_SPD_1000 | E1000_CTRL_FRCSPD | - E1000_CTRL_FD | E1000_CTRL_FRCDPX; + /* Force link up, set 1gb, set both sw defined pins */ + reg = rd32(E1000_CTRL); + reg |= E1000_CTRL_SLU | + E1000_CTRL_SPD_1000 | + E1000_CTRL_FRCSPD | + E1000_CTRL_SWDPIN0 | + E1000_CTRL_SWDPIN1; + wr32(E1000_CTRL, reg); + + /* Power on phy for 82576 fiber adapters */ + if (hw->mac.type == e1000_82576) { + reg = rd32(E1000_CTRL_EXT); + reg &= ~E1000_CTRL_EXT_SDP7_DATA; + wr32(E1000_CTRL_EXT, reg); } - wr32(E1000_CTRL, ctrl_reg); + /* Set switch control to serdes energy detect */ + reg = rd32(E1000_CONNSW); + reg |= E1000_CONNSW_ENRGSRC; + wr32(E1000_CONNSW, reg); /* * New SerDes mode allows for forcing speed or autonegotiating speed @@ -1070,21 +1031,12 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) * mode that will be compatible with older link partners and switches. * However, both are supported by the hardware and some drivers/tools. */ + reg = rd32(E1000_PCS_LCTL); reg &= ~(E1000_PCS_LCTL_AN_ENABLE | E1000_PCS_LCTL_FLV_LINK_UP | E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK); - /* - * We force flow control to prevent the CTRL register values from being - * overwritten by the autonegotiated flow control values - */ - reg |= E1000_PCS_LCTL_FORCE_FCTRL; - - /* - * we always set sgmii to autoneg since it is the phy that will be - * forcing the link and the serdes is just a go-between - */ - if (hw->mac.autoneg || igb_sgmii_active_82575(hw)) { + if (hw->mac.autoneg) { /* Set PCS register for autoneg */ reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */ E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */ @@ -1101,14 +1053,77 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg); } - wr32(E1000_PCS_LCTL, reg); - - if (!igb_sgmii_active_82575(hw)) + if (hw->mac.type == e1000_82576) { + reg |= E1000_PCS_LCTL_FORCE_FCTRL; igb_force_mac_fc(hw); + } + + wr32(E1000_PCS_LCTL, reg); return 0; } +/** + * igb_configure_pcs_link_82575 - Configure PCS link + * @hw: pointer to the HW structure + * + * Configure the physical coding sub-layer (PCS) link. The PCS link is + * only used on copper connections where the serialized gigabit media + * independent interface (sgmii) is being used. Configures the link + * for auto-negotiation or forces speed/duplex. + **/ +static void igb_configure_pcs_link_82575(struct e1000_hw *hw) +{ + struct e1000_mac_info *mac = &hw->mac; + u32 reg = 0; + + if (hw->phy.media_type != e1000_media_type_copper || + !(igb_sgmii_active_82575(hw))) + return; + + /* For SGMII, we need to issue a PCS autoneg restart */ + reg = rd32(E1000_PCS_LCTL); + + /* AN time out should be disabled for SGMII mode */ + reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT); + + if (mac->autoneg) { + /* Make sure forced speed and force link are not set */ + reg &= ~(E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK); + + /* + * The PHY should be setup prior to calling this function. + * All we need to do is restart autoneg and enable autoneg. + */ + reg |= E1000_PCS_LCTL_AN_RESTART | E1000_PCS_LCTL_AN_ENABLE; + } else { + /* Set PCS register for forced speed */ + + /* Turn off bits for full duplex, speed, and autoneg */ + reg &= ~(E1000_PCS_LCTL_FSV_1000 | + E1000_PCS_LCTL_FSV_100 | + E1000_PCS_LCTL_FDV_FULL | + E1000_PCS_LCTL_AN_ENABLE); + + /* Check for duplex first */ + if (mac->forced_speed_duplex & E1000_ALL_FULL_DUPLEX) + reg |= E1000_PCS_LCTL_FDV_FULL; + + /* Now set speed */ + if (mac->forced_speed_duplex & E1000_ALL_100_SPEED) + reg |= E1000_PCS_LCTL_FSV_100; + + /* Force speed and force link */ + reg |= E1000_PCS_LCTL_FSD | + E1000_PCS_LCTL_FORCE_LINK | + E1000_PCS_LCTL_FLV_LINK_UP; + + hw_dbg("Wrote 0x%08X to PCS_LCTL to configure forced link\n", + reg); + } + wr32(E1000_PCS_LCTL, reg); +} + /** * igb_sgmii_active_82575 - Return sgmii state * @hw: pointer to the HW structure @@ -1233,8 +1248,7 @@ static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw) temp = rd32(E1000_LENERRS); /* This register should not be read in copper configurations */ - if (hw->phy.media_type == e1000_media_type_internal_serdes || - igb_sgmii_active_82575(hw)) + if (hw->phy.media_type == e1000_media_type_internal_serdes) temp = rd32(E1000_SCVPC); } diff --git a/trunk/drivers/net/igb/e1000_82575.h b/trunk/drivers/net/igb/e1000_82575.h index ebd146fd4e15..8a1e6597061f 100644 --- a/trunk/drivers/net/igb/e1000_82575.h +++ b/trunk/drivers/net/igb/e1000_82575.h @@ -28,7 +28,7 @@ #ifndef _E1000_82575_H_ #define _E1000_82575_H_ -extern void igb_shutdown_serdes_link_82575(struct e1000_hw *hw); +extern void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw); extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw); #define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \ diff --git a/trunk/drivers/net/igb/e1000_defines.h b/trunk/drivers/net/igb/e1000_defines.h index cb916833f303..c85829355d50 100644 --- a/trunk/drivers/net/igb/e1000_defines.h +++ b/trunk/drivers/net/igb/e1000_defines.h @@ -44,7 +44,7 @@ #define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */ /* Extended Device Control */ -#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Defineable Pin 3 */ +#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */ /* Physical Func Reset Done Indication */ #define E1000_CTRL_EXT_PFRSTD 0x00004000 #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 diff --git a/trunk/drivers/net/igb/e1000_phy.c b/trunk/drivers/net/igb/e1000_phy.c index ee460600e74b..c1f4da630420 100644 --- a/trunk/drivers/net/igb/e1000_phy.c +++ b/trunk/drivers/net/igb/e1000_phy.c @@ -1565,12 +1565,9 @@ s32 igb_get_phy_info_igp(struct e1000_hw *hw) **/ s32 igb_phy_sw_reset(struct e1000_hw *hw) { - s32 ret_val = 0; + s32 ret_val; u16 phy_ctrl; - if (!(hw->phy.ops.read_reg)) - goto out; - ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); if (ret_val) goto out; diff --git a/trunk/drivers/net/igb/igb_main.c b/trunk/drivers/net/igb/igb_main.c index d2639c4a086d..943186b78483 100644 --- a/trunk/drivers/net/igb/igb_main.c +++ b/trunk/drivers/net/igb/igb_main.c @@ -5320,7 +5320,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake) *enable_wake = wufc || adapter->en_mng_pt; if (!*enable_wake) - igb_shutdown_serdes_link_82575(hw); + igb_shutdown_fiber_serdes_link_82575(hw); /* Release control of h/w to f/w. If f/w is AMT enabled, this * would have already happened in close and is redundant. */ diff --git a/trunk/drivers/net/ixgbe/ixgbe_82598.c b/trunk/drivers/net/ixgbe/ixgbe_82598.c index 56b12f3192f1..cb7f0c3c6e16 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_82598.c +++ b/trunk/drivers/net/ixgbe/ixgbe_82598.c @@ -322,16 +322,14 @@ static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw) break; case IXGBE_DEV_ID_82598AF_DUAL_PORT: case IXGBE_DEV_ID_82598AF_SINGLE_PORT: + case IXGBE_DEV_ID_82598EB_CX4: + case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: case IXGBE_DEV_ID_82598_DA_DUAL_PORT: case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: case IXGBE_DEV_ID_82598EB_XF_LR: case IXGBE_DEV_ID_82598EB_SFP_LOM: media_type = ixgbe_media_type_fiber; break; - case IXGBE_DEV_ID_82598EB_CX4: - case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: - media_type = ixgbe_media_type_cx4; - break; case IXGBE_DEV_ID_82598AT: case IXGBE_DEV_ID_82598AT2: media_type = ixgbe_media_type_copper; diff --git a/trunk/drivers/net/ixgbe/ixgbe_82599.c b/trunk/drivers/net/ixgbe/ixgbe_82599.c index 2ec58dcdb82b..61af47e75aa1 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_82599.c +++ b/trunk/drivers/net/ixgbe/ixgbe_82599.c @@ -337,9 +337,6 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) case IXGBE_DEV_ID_82599_SFP: media_type = ixgbe_media_type_fiber; break; - case IXGBE_DEV_ID_82599_CX4: - media_type = ixgbe_media_type_cx4; - break; default: media_type = ixgbe_media_type_unknown; break; diff --git a/trunk/drivers/net/ixgbe/ixgbe_main.c b/trunk/drivers/net/ixgbe/ixgbe_main.c index 59ad9590e700..45bf8b9716e3 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_main.c +++ b/trunk/drivers/net/ixgbe/ixgbe_main.c @@ -97,8 +97,6 @@ static struct pci_device_id ixgbe_pci_tbl[] = { board_82599 }, {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP), board_82599 }, - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), - board_82599 }, /* required last entry */ {0, } @@ -2057,8 +2055,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) rx_ring->flags |= IXGBE_RING_RX_PS_ENABLED; - else - rx_ring->flags &= ~IXGBE_RING_RX_PS_ENABLED; #ifdef IXGBE_FCOE if (netdev->features & NETIF_F_FCOE_MTU) { diff --git a/trunk/drivers/net/ixgbe/ixgbe_type.h b/trunk/drivers/net/ixgbe/ixgbe_type.h index 8761d7899f7d..8ba90eec1dc9 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_type.h +++ b/trunk/drivers/net/ixgbe/ixgbe_type.h @@ -49,7 +49,6 @@ #define IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM 0x10E1 #define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4 #define IXGBE_DEV_ID_82599_KX4 0x10F7 -#define IXGBE_DEV_ID_82599_CX4 0x10F9 #define IXGBE_DEV_ID_82599_SFP 0x10FB #define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC @@ -2144,7 +2143,6 @@ enum ixgbe_media_type { ixgbe_media_type_fiber, ixgbe_media_type_copper, ixgbe_media_type_backplane, - ixgbe_media_type_cx4, ixgbe_media_type_virtual }; diff --git a/trunk/drivers/net/mlx4/catas.c b/trunk/drivers/net/mlx4/catas.c index f599294fa8ab..aa9674b7f19c 100644 --- a/trunk/drivers/net/mlx4/catas.c +++ b/trunk/drivers/net/mlx4/catas.c @@ -96,17 +96,12 @@ static void catas_reset(struct work_struct *work) spin_unlock_irq(&catas_lock); list_for_each_entry_safe(priv, tmppriv, &tlist, catas_err.list) { - struct pci_dev *pdev = priv->dev.pdev; - ret = mlx4_restart_one(priv->dev.pdev); - /* 'priv' now is not valid */ + dev = &priv->dev; if (ret) - printk(KERN_ERR "mlx4 %s: Reset failed (%d)\n", - pci_name(pdev), ret); - else { - dev = pci_get_drvdata(pdev); + mlx4_err(dev, "Reset failed (%d)\n", ret); + else mlx4_dbg(dev, "Reset succeeded\n"); - } } } diff --git a/trunk/drivers/net/pcmcia/pcnet_cs.c b/trunk/drivers/net/pcmcia/pcnet_cs.c index 97db1c732342..90a94d215831 100644 --- a/trunk/drivers/net/pcmcia/pcnet_cs.c +++ b/trunk/drivers/net/pcmcia/pcnet_cs.c @@ -1750,11 +1750,11 @@ static struct pcmcia_device_id pcnet_ids[] = { PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), /* too generic! */ /* PCMCIA_DEVICE_PROD_ID12("PCMCIA", "10/100 Ethernet Card", 0x281f1c5d, 0x11b0ffc0), */ - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet GSM", 0xf5f025c2, 0x4ae85d35, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "cis/PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet GSM", 0xf5f025c2, 0x4ae85d35, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "PCMLM28.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID12(0, "DAYNA COMMUNICATIONS", "LAN AND MODEM MULTIFUNCTION", 0x8fdf8f89, 0xdd5ed9e8, "DP83903.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID4(0, "NSC MF LAN/Modem", 0x58fc6056, "DP83903.cis"), PCMCIA_MFC_DEVICE_CIS_MANF_CARD(0, 0x0175, 0x0000, "DP83903.cis"), diff --git a/trunk/drivers/net/pppol2tp.c b/trunk/drivers/net/pppol2tp.c index cc394d073755..e0f9219a0aea 100644 --- a/trunk/drivers/net/pppol2tp.c +++ b/trunk/drivers/net/pppol2tp.c @@ -229,7 +229,7 @@ static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel); static atomic_t pppol2tp_tunnel_count; static atomic_t pppol2tp_session_count; static struct ppp_channel_ops pppol2tp_chan_ops = { pppol2tp_xmit , NULL }; -static const struct proto_ops pppol2tp_ops; +static struct proto_ops pppol2tp_ops; /* per-net private data for this module */ static int pppol2tp_net_id; @@ -2574,7 +2574,7 @@ static const struct file_operations pppol2tp_proc_fops = { * Init and cleanup *****************************************************************************/ -static const struct proto_ops pppol2tp_ops = { +static struct proto_ops pppol2tp_ops = { .family = AF_PPPOX, .owner = THIS_MODULE, .release = pppol2tp_release, diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index 4bb52e9cd371..00bc65a0aac9 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -65,8 +65,8 @@ #define RX_DEF_PENDING RX_MAX_PENDING /* This is the worst case number of transmit list elements for a single skb: - VLAN:GSO + CKSUM + Data + skb_frags * DMA */ -#define MAX_SKB_TX_LE (2 + (sizeof(dma_addr_t)/sizeof(u32))*(MAX_SKB_FRAGS+1)) + VLAN + TSO + CKSUM + Data + skb_frags * DMA */ +#define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) #define TX_MIN_PENDING (MAX_SKB_TX_LE+1) #define TX_MAX_PENDING 4096 #define TX_DEF_PENDING 127 @@ -1567,13 +1567,11 @@ static unsigned tx_le_req(const struct sk_buff *skb) { unsigned count; - count = (skb_shinfo(skb)->nr_frags + 1) - * (sizeof(dma_addr_t) / sizeof(u32)); + count = sizeof(dma_addr_t) / sizeof(u32); + count += skb_shinfo(skb)->nr_frags * count; if (skb_is_gso(skb)) ++count; - else if (sizeof(dma_addr_t) == sizeof(u32)) - ++count; /* possible vlan */ if (skb->ip_summed == CHECKSUM_PARTIAL) ++count; @@ -4550,18 +4548,16 @@ static int __devinit sky2_probe(struct pci_dev *pdev, if (hw->ports > 1) { struct net_device *dev1; - err = -ENOMEM; dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); - if (dev1 && (err = register_netdev(dev1)) == 0) - sky2_show_addr(dev1); - else { + if (!dev1) + dev_warn(&pdev->dev, "allocation for second device failed\n"); + else if ((err = register_netdev(dev1))) { dev_warn(&pdev->dev, "register of second port failed (%d)\n", err); hw->dev[1] = NULL; - hw->ports = 1; - if (dev1) - free_netdev(dev1); - } + free_netdev(dev1); + } else + sky2_show_addr(dev1); } setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); diff --git a/trunk/drivers/net/smc91x.h b/trunk/drivers/net/smc91x.h index 9c8c6ed4a3cd..57a159fac99f 100644 --- a/trunk/drivers/net/smc91x.h +++ b/trunk/drivers/net/smc91x.h @@ -83,6 +83,34 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) } } +#elif defined(CONFIG_BLACKFIN) + +#define SMC_IRQ_FLAGS IRQF_TRIGGER_HIGH +#define RPC_LSA_DEFAULT RPC_LED_100_10 +#define RPC_LSB_DEFAULT RPC_LED_TX_RX + +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +# if defined(CONFIG_BF561) +#define SMC_CAN_USE_32BIT 1 +# else +#define SMC_CAN_USE_32BIT 0 +# endif +#define SMC_IO_SHIFT 0 +#define SMC_NOWAIT 1 +#define SMC_USE_BFIN_DMA 0 + +#define SMC_inw(a, r) readw((a) + (r)) +#define SMC_outw(v, a, r) writew(v, (a) + (r)) +#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) +#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) +# if SMC_CAN_USE_32BIT +#define SMC_inl(a, r) readl((a) + (r)) +#define SMC_outl(v, a, r) writel(v, (a) + (r)) +#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) +#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) +# endif + #elif defined(CONFIG_REDWOOD_5) || defined(CONFIG_REDWOOD_6) /* We can only do 16-bit reads and writes in the static memory space. */ diff --git a/trunk/drivers/net/usb/cdc-phonet.c b/trunk/drivers/net/usb/cdc-phonet.c index 33d5c579c5ad..97e54d9d03ce 100644 --- a/trunk/drivers/net/usb/cdc-phonet.c +++ b/trunk/drivers/net/usb/cdc-phonet.c @@ -264,6 +264,7 @@ static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) switch (cmd) { case SIOCPNGAUTOCONF: req->ifr_phonet_autoconf.device = PN_DEV_PC; + printk(KERN_CRIT"device is PN_DEV_PC\n"); return 0; } return -ENOIOCTLCMD; diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index 49ea9c92b7e6..ad89d23968df 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -5,7 +5,6 @@ menuconfig WLAN bool "Wireless LAN" depends on !S390 - default y ---help--- This section contains all the pre 802.11 and 802.11 wireless device drivers. For a complete list of drivers and documentation diff --git a/trunk/drivers/net/wireless/ath/ath9k/ani.c b/trunk/drivers/net/wireless/ath/ath9k/ani.c index 2b493742ef10..a7cbb07988cf 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ani.c +++ b/trunk/drivers/net/wireless/ath/ath9k/ani.c @@ -327,8 +327,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) aniState->firstepLevel + 1); return; } else { - if ((conf->channel->band == IEEE80211_BAND_2GHZ) && - !conf_is_ht(conf)) { + if (conf->channel->band == IEEE80211_BAND_2GHZ) { if (!aniState->ofdmWeakSigDetectOff) ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, @@ -370,8 +369,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah) ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1); } else { - if ((conf->channel->band == IEEE80211_BAND_2GHZ) && - !conf_is_ht(conf)) { + if (conf->channel->band == IEEE80211_BAND_2GHZ) { if (aniState->firstepLevel > 0) ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); diff --git a/trunk/drivers/net/wireless/b43/main.c b/trunk/drivers/net/wireless/b43/main.c index e789792a36bc..7a9a3fa55425 100644 --- a/trunk/drivers/net/wireless/b43/main.c +++ b/trunk/drivers/net/wireless/b43/main.c @@ -2289,7 +2289,11 @@ static int b43_upload_microcode(struct b43_wldev *dev) err = -ENODEV; goto error; } - msleep(50); + msleep_interruptible(50); + if (signal_pending(current)) { + err = -EINTR; + goto error; + } } b43_read32(dev, B43_MMIO_GEN_IRQ_REASON); /* dummy read */ @@ -4283,8 +4287,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev) if (!dev->suspend_in_progress) b43_rng_init(wl); - ieee80211_wake_queues(dev->wl->hw); - b43_set_status(dev, B43_STAT_INITIALIZED); if (!dev->suspend_in_progress) diff --git a/trunk/drivers/net/wireless/hostap/hostap_main.c b/trunk/drivers/net/wireless/hostap/hostap_main.c index eb57d1ea361f..6fe122f18c0d 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_main.c +++ b/trunk/drivers/net/wireless/hostap/hostap_main.c @@ -875,16 +875,15 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local, switch(type) { case HOSTAP_INTERFACE_AP: - dev->tx_queue_len = 0; /* use main radio device queue */ dev->netdev_ops = &hostap_mgmt_netdev_ops; dev->type = ARPHRD_IEEE80211; dev->header_ops = &hostap_80211_ops; break; case HOSTAP_INTERFACE_MASTER: + dev->tx_queue_len = 0; /* use main radio device queue */ dev->netdev_ops = &hostap_master_ops; break; default: - dev->tx_queue_len = 0; /* use main radio device queue */ dev->netdev_ops = &hostap_netdev_ops; } diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c b/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c index ca61d3796cef..6a13bfbc9d98 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c @@ -2346,7 +2346,6 @@ struct iwl_cfg iwl4965_agn_cfg = { .mod_params = &iwl4965_mod_params, .use_isr_legacy = true, .ht_greenfield_support = false, - .broken_powersave = true, }; /* Module firmware */ diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 346dc06fa7b7..40b207aa8fef 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c @@ -760,7 +760,6 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta, u16 high_low; u8 switch_to_legacy = 0; u8 is_green = lq_sta->is_green; - struct iwl_priv *priv = lq_sta->drv; /* check if we need to switch from HT to legacy rates. * assumption is that mandatory rates (1Mbps or 6Mbps) @@ -774,8 +773,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta, tbl->lq_type = LQ_G; if (num_of_ant(tbl->ant_type) > 1) - tbl->ant_type = - first_antenna(priv->hw_params.valid_tx_ant); + tbl->ant_type = ANT_A;/*FIXME:RS*/ tbl->is_ht40 = 0; tbl->is_SGI = 0; @@ -885,12 +883,6 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */ if (mac_index >= (IWL_RATE_9M_INDEX - IWL_FIRST_OFDM_RATE)) mac_index++; - /* - * mac80211 HT index is always zero-indexed; we need to move - * HT OFDM rates after CCK rates in 2.4 GHz band - */ - if (priv->band == IEEE80211_BAND_2GHZ) - mac_index += IWL_FIRST_OFDM_RATE; } if ((mac_index < 0) || diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c index fd26c0dc9c54..acfd7b40afb8 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c @@ -1585,12 +1585,9 @@ int iwl_setup_mac(struct iwl_priv *priv) hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_NOISE_DBM | IEEE80211_HW_AMPDU_AGGREGATION | - IEEE80211_HW_SPECTRUM_MGMT; - - if (!priv->cfg->broken_powersave) - hw->flags |= IEEE80211_HW_SUPPORTS_PS | - IEEE80211_HW_SUPPORTS_DYNAMIC_PS; - + IEEE80211_HW_SPECTRUM_MGMT | + IEEE80211_HW_SUPPORTS_PS | + IEEE80211_HW_SUPPORTS_DYNAMIC_PS; hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.h b/trunk/drivers/net/wireless/iwlwifi/iwl-core.h index 7ff9ffb2b702..c04d2a270819 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.h @@ -252,7 +252,6 @@ struct iwl_cfg { const u16 max_ll_items; const bool shadow_ram_support; const bool ht_greenfield_support; - const bool broken_powersave; }; /*************************** diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-power.c b/trunk/drivers/net/wireless/iwlwifi/iwl-power.c index 60be976afff8..4ec6a8307cc6 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-power.c @@ -292,9 +292,8 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) else dtimper = 1; - if (priv->cfg->broken_powersave) - iwl_power_sleep_cam_cmd(priv, &cmd); - else if (tt->state >= IWL_TI_1) + /* TT power setting overwrites everything */ + if (tt->state >= IWL_TI_1) iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper); else if (!enabled) iwl_power_sleep_cam_cmd(priv, &cmd); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c index b90adcb73b06..8150c5c3a16b 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c @@ -239,22 +239,26 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority) struct iwl_rx_queue *rxq = &priv->rxq; struct list_head *element; struct iwl_rx_mem_buffer *rxb; - struct sk_buff *skb; unsigned long flags; while (1) { spin_lock_irqsave(&rxq->lock, flags); + if (list_empty(&rxq->rx_used)) { spin_unlock_irqrestore(&rxq->lock, flags); return; } + element = rxq->rx_used.next; + rxb = list_entry(element, struct iwl_rx_mem_buffer, list); + list_del(element); + spin_unlock_irqrestore(&rxq->lock, flags); /* Alloc a new receive buffer */ - skb = alloc_skb(priv->hw_params.rx_buf_size + 256, + rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256, priority); - if (!skb) { + if (!rxb->skb) { IWL_CRIT(priv, "Can not allocate SKB buffers\n"); /* We don't reschedule replenish work here -- we will * call the restock method and if it still needs @@ -262,20 +266,6 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority) break; } - spin_lock_irqsave(&rxq->lock, flags); - - if (list_empty(&rxq->rx_used)) { - spin_unlock_irqrestore(&rxq->lock, flags); - dev_kfree_skb_any(skb); - return; - } - element = rxq->rx_used.next; - rxb = list_entry(element, struct iwl_rx_mem_buffer, list); - list_del(element); - - spin_unlock_irqrestore(&rxq->lock, flags); - - rxb->skb = skb; /* Get physical address of RB/SKB */ rxb->real_dma_addr = pci_map_single( priv->pci_dev, diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c index 090966837f3c..2238c9f2018c 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -1134,7 +1134,6 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority) struct iwl_rx_queue *rxq = &priv->rxq; struct list_head *element; struct iwl_rx_mem_buffer *rxb; - struct sk_buff *skb; unsigned long flags; while (1) { @@ -1144,11 +1143,17 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority) spin_unlock_irqrestore(&rxq->lock, flags); return; } + + element = rxq->rx_used.next; + rxb = list_entry(element, struct iwl_rx_mem_buffer, list); + list_del(element); spin_unlock_irqrestore(&rxq->lock, flags); /* Alloc a new receive buffer */ - skb = alloc_skb(priv->hw_params.rx_buf_size, priority); - if (!skb) { + rxb->skb = + alloc_skb(priv->hw_params.rx_buf_size, + priority); + if (!rxb->skb) { if (net_ratelimit()) IWL_CRIT(priv, ": Can not allocate SKB buffers\n"); /* We don't reschedule replenish work here -- we will @@ -1157,19 +1162,6 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority) break; } - spin_lock_irqsave(&rxq->lock, flags); - if (list_empty(&rxq->rx_used)) { - spin_unlock_irqrestore(&rxq->lock, flags); - dev_kfree_skb_any(skb); - return; - } - element = rxq->rx_used.next; - rxb = list_entry(element, struct iwl_rx_mem_buffer, list); - list_del(element); - spin_unlock_irqrestore(&rxq->lock, flags); - - rxb->skb = skb; - /* If radiotap head is required, reserve some headroom here. * The physical head count is a variable rx_stats->phy_count. * We reserve 4 bytes here. Plus these extra bytes, the diff --git a/trunk/drivers/net/wireless/p54/p54usb.c b/trunk/drivers/net/wireless/p54/p54usb.c index 17e199546eeb..e44460ff149c 100644 --- a/trunk/drivers/net/wireless/p54/p54usb.c +++ b/trunk/drivers/net/wireless/p54/p54usb.c @@ -67,7 +67,6 @@ static struct usb_device_id p54u_table[] __devinitdata = { {USB_DEVICE(0x0bf8, 0x1009)}, /* FUJITSU E-5400 USB D1700*/ {USB_DEVICE(0x0cde, 0x0006)}, /* Medion MD40900 */ {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */ - {USB_DEVICE(0x0cde, 0x0015)}, /* Zcomax XG-705A */ {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */ {USB_DEVICE(0x124a, 0x4025)}, /* IOGear GWU513 (GW3887IK chip) */ {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */ diff --git a/trunk/drivers/net/wireless/wl12xx/wl1271_main.c b/trunk/drivers/net/wireless/wl12xx/wl1271_main.c index f6f8895bbc89..d9169b47ac42 100644 --- a/trunk/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/trunk/drivers/net/wireless/wl12xx/wl1271_main.c @@ -644,10 +644,11 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw, { struct wl1271 *wl = hw->priv; struct sk_buff *beacon; + DECLARE_MAC_BUF(mac); int ret; wl1271_debug(DEBUG_MAC80211, "mac80211 config_interface bssid %s", - printf("%pM", conf->bssid); + print_mac(mac, conf->bssid)); wl1271_dump_ascii(DEBUG_MAC80211, "ssid: ", conf->ssid, conf->ssid_len); diff --git a/trunk/drivers/serial/serial_cs.c b/trunk/drivers/serial/serial_cs.c index ed4648b556c7..79c9c5f5cdba 100644 --- a/trunk/drivers/serial/serial_cs.c +++ b/trunk/drivers/serial/serial_cs.c @@ -868,11 +868,11 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_DEVICE_PROD_ID12("PCMCIA ", "C336MX ", 0x99bcafe9, 0xaa25bcab), PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "PCMCIA Dual RS-232 Serial Port Card", 0xc4420b35, 0x92abc92f), PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "Dual RS-232 Serial Port PC Card", 0xc4420b35, 0x031a380d), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet GSM", 0xf5f025c2, 0x4ae85d35, "cis/PCMLM28.cis"), - PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "cis/PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet GSM", 0xf5f025c2, 0x4ae85d35, "PCMLM28.cis"), + PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "PCMLM28.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID12(1, "DAYNA COMMUNICATIONS", "LAN AND MODEM MULTIFUNCTION", 0x8fdf8f89, 0xdd5ed9e8, "DP83903.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID4(1, "NSC MF LAN/Modem", 0x58fc6056, "DP83903.cis"), PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0556, "cis/3CCFEM556.cis"), @@ -883,10 +883,10 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0x0710, "SW_7xx_SER.cis"), /* Sierra Wireless AC710/AC750 GPRS Network Adapter R1 */ PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */ - PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "cis/MT5634ZLX.cis"), + PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "MT5634ZLX.cis"), PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), - PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"), + PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"), PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"), PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100 1.00.",0x19ca78af,0xf964f42b), PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100",0x19ca78af,0x71d98e83), diff --git a/trunk/drivers/ssb/pci.c b/trunk/drivers/ssb/pci.c index 9e50896233aa..f853d5600ca7 100644 --- a/trunk/drivers/ssb/pci.c +++ b/trunk/drivers/ssb/pci.c @@ -600,7 +600,6 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out, ssb_printk(KERN_WARNING PFX "Unsupported SPROM" " revision %d detected. Will extract" " v1\n", out->revision); - out->revision = 1; sprom_extract_r123(out, in); } } diff --git a/trunk/drivers/ssb/sdio.c b/trunk/drivers/ssb/sdio.c index 65a6080cb02a..114051056b52 100644 --- a/trunk/drivers/ssb/sdio.c +++ b/trunk/drivers/ssb/sdio.c @@ -21,7 +21,7 @@ #include "ssb_private.h" /* Define the following to 1 to enable a printk on each coreswitch. */ -#define SSB_VERBOSE_SDIOCORESWITCH_DEBUG 0 +#define SSB_VERBOSE_SDIOCORESWITCH_DEBUG 1 /* Hardware invariants CIS tuples */ @@ -333,7 +333,7 @@ static void ssb_sdio_block_read(struct ssb_device *dev, void *buffer, goto out; err_out: - dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%zu), error %d\n", + dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%u), error %d\n", bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error); out: sdio_release_host(bus->host_sdio); @@ -440,7 +440,7 @@ static void ssb_sdio_block_write(struct ssb_device *dev, const void *buffer, goto out; err_out: - dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%zu), error %d\n", + dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%u), error %d\n", bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error); out: sdio_release_host(bus->host_sdio); diff --git a/trunk/firmware/Makefile b/trunk/firmware/Makefile index ffe2663d49f2..878329cf4825 100644 --- a/trunk/firmware/Makefile +++ b/trunk/firmware/Makefile @@ -51,10 +51,9 @@ fw-shipped-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \ e100/d102e_ucode.bin fw-shipped-$(CONFIG_MYRI_SBUS) += myricom/lanai.bin -fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis cis/PCMLM28.cis +fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis fw-shipped-$(CONFIG_PCMCIA_3C589) += cis/3CXEM556.cis fw-shipped-$(CONFIG_PCMCIA_3C574) += cis/3CCFEM556.cis -fw-shipped-$(CONFIG_SERIAL_8250_CS) += cis/MT5634ZLX.cis cis/RS-COM-2P.cis fw-shipped-$(CONFIG_PCMCIA_SMC91C92) += ositech/Xilinx7OD.bin fw-shipped-$(CONFIG_SCSI_ADVANSYS) += advansys/mcode.bin advansys/38C1600.bin \ advansys/3550.bin advansys/38C0800.bin diff --git a/trunk/firmware/WHENCE b/trunk/firmware/WHENCE index 82db5256a4e5..d9e3a94cb4df 100644 --- a/trunk/firmware/WHENCE +++ b/trunk/firmware/WHENCE @@ -596,7 +596,6 @@ Found in hex form in kernel source. Driver: PCMCIA_PCNET - NE2000 compatible PCMCIA adapter File: cis/LA-PCM.cis - cis/PCMLM28.cis Licence: GPL @@ -624,17 +623,6 @@ Originally developed by the pcmcia-cs project -------------------------------------------------------------------------- -Driver: SERIAL_8250_CS - Serial PCMCIA adapter - -File: cis/MT5634ZLX.cis - cis/RS-COM-2P.cis - -Licence: GPL - -Originally developed by the pcmcia-cs project - --------------------------------------------------------------------------- - Driver: PCMCIA_SMC91C92 - SMC 91Cxx PCMCIA File: ositech/Xilinx7OD.bin diff --git a/trunk/firmware/cis/MT5634ZLX.cis.ihex b/trunk/firmware/cis/MT5634ZLX.cis.ihex deleted file mode 100644 index 72500b9d95d8..000000000000 --- a/trunk/firmware/cis/MT5634ZLX.cis.ihex +++ /dev/null @@ -1,11 +0,0 @@ -:100000000101FF152204014D756C74695465636824 -:100010000050434D4349412035364B2044617461C3 -:10002000466178000000FF20040002010021020266 -:10003000001A05012780FF671B0FCF418B01550177 -:10004000550155AA60F80307281B08970108AA6004 -:10005000F802071B089F0108AA60E803071B08A70E -:0B0060000108AA60E802071400FF007E -:00000001FF -# -# Replacement CIS for Multitech MT5634ZLX modems -# diff --git a/trunk/firmware/cis/PCMLM28.cis.ihex b/trunk/firmware/cis/PCMLM28.cis.ihex deleted file mode 100644 index ffdfe8522ef5..000000000000 --- a/trunk/firmware/cis/PCMLM28.cis.ihex +++ /dev/null @@ -1,18 +0,0 @@ -:1000000001030000FF151504014C494E4B53595391 -:100010000050434D4C4D3238000000FF2004430196 -:10002000ABC0210200001A05012FF803031B10E4E6 -:1000300001190155E06100031FF8020730FFFF1BA3 -:100040000BA50108E06120031FF802071B0BA601A6 -:1000500008E06140031FF802071B0BA70108E061DD -:1000600060031FF802071B0BA80108E06100031FD3 -:10007000E803071B0BA90108E06120031FE8030741 -:100080001B0BAA0108E06140031FE803071B0BAB31 -:100090000108E06160031FE803071B0BAC0108E0E7 -:1000A0006100031FE802071B0BAD0108E06120039C -:1000B0001FE802071B0BAE0108E06140031FE802C6 -:1000C000071B0BAF0108E06160031FE80207140083 -:0200D000FF002F -:00000001FF -# -# The on-card CIS says it is MFC-compliant, but it is not -# diff --git a/trunk/firmware/cis/RS-COM-2P.cis.ihex b/trunk/firmware/cis/RS-COM-2P.cis.ihex deleted file mode 100644 index 0801ca5da80a..000000000000 --- a/trunk/firmware/cis/RS-COM-2P.cis.ihex +++ /dev/null @@ -1,10 +0,0 @@ -:1000000001030000FF1516040150434D4349410010 -:1000100052532D434F4D203250000000FF21020269 -:10002000011A0501030001011B0EC18118AA61E834 -:100030000307E8020730B89E1B0B820108AA615033 -:1000400002075802071B0B830108AA6160020768B8 -:0600500002071400FF008E -:00000001FF -# -# Replacement CIS for dual-serial-port IO card -# diff --git a/trunk/include/keys/rxrpc-type.h b/trunk/include/keys/rxrpc-type.h index 5cb86c307f5d..7609365577f1 100644 --- a/trunk/include/keys/rxrpc-type.h +++ b/trunk/include/keys/rxrpc-type.h @@ -21,111 +21,4 @@ extern struct key_type key_type_rxrpc; extern struct key *rxrpc_get_null_key(const char *); -/* - * RxRPC key for Kerberos IV (type-2 security) - */ -struct rxkad_key { - u32 vice_id; - u32 start; /* time at which ticket starts */ - u32 expiry; /* time at which ticket expires */ - u32 kvno; /* key version number */ - u8 primary_flag; /* T if key for primary cell for this user */ - u16 ticket_len; /* length of ticket[] */ - u8 session_key[8]; /* DES session key */ - u8 ticket[0]; /* the encrypted ticket */ -}; - -/* - * Kerberos 5 principal - * name/name/name@realm - */ -struct krb5_principal { - u8 n_name_parts; /* N of parts of the name part of the principal */ - char **name_parts; /* parts of the name part of the principal */ - char *realm; /* parts of the realm part of the principal */ -}; - -/* - * Kerberos 5 tagged data - */ -struct krb5_tagged_data { - /* for tag value, see /usr/include/krb5/krb5.h - * - KRB5_AUTHDATA_* for auth data - * - - */ - s32 tag; - u32 data_len; - u8 *data; -}; - -/* - * RxRPC key for Kerberos V (type-5 security) - */ -struct rxk5_key { - u64 authtime; /* time at which auth token generated */ - u64 starttime; /* time at which auth token starts */ - u64 endtime; /* time at which auth token expired */ - u64 renew_till; /* time to which auth token can be renewed */ - s32 is_skey; /* T if ticket is encrypted in another ticket's - * skey */ - s32 flags; /* mask of TKT_FLG_* bits (krb5/krb5.h) */ - struct krb5_principal client; /* client principal name */ - struct krb5_principal server; /* server principal name */ - u16 ticket_len; /* length of ticket */ - u16 ticket2_len; /* length of second ticket */ - u8 n_authdata; /* number of authorisation data elements */ - u8 n_addresses; /* number of addresses */ - struct krb5_tagged_data session; /* session data; tag is enctype */ - struct krb5_tagged_data *addresses; /* addresses */ - u8 *ticket; /* krb5 ticket */ - u8 *ticket2; /* second krb5 ticket, if related to ticket (via - * DUPLICATE-SKEY or ENC-TKT-IN-SKEY) */ - struct krb5_tagged_data *authdata; /* authorisation data */ -}; - -/* - * list of tokens attached to an rxrpc key - */ -struct rxrpc_key_token { - u16 security_index; /* RxRPC header security index */ - struct rxrpc_key_token *next; /* the next token in the list */ - union { - struct rxkad_key *kad; - struct rxk5_key *k5; - }; -}; - -/* - * structure of raw payloads passed to add_key() or instantiate key - */ -struct rxrpc_key_data_v1 { - u32 kif_version; /* 1 */ - u16 security_index; - u16 ticket_length; - u32 expiry; /* time_t */ - u32 kvno; - u8 session_key[8]; - u8 ticket[0]; -}; - -/* - * AF_RXRPC key payload derived from XDR format - * - based on openafs-1.4.10/src/auth/afs_token.xg - */ -#define AFSTOKEN_LENGTH_MAX 16384 /* max payload size */ -#define AFSTOKEN_STRING_MAX 256 /* max small string length */ -#define AFSTOKEN_DATA_MAX 64 /* max small data length */ -#define AFSTOKEN_CELL_MAX 64 /* max cellname length */ -#define AFSTOKEN_MAX 8 /* max tokens per payload */ -#define AFSTOKEN_BDATALN_MAX 16384 /* max big data length */ -#define AFSTOKEN_RK_TIX_MAX 12000 /* max RxKAD ticket size */ -#define AFSTOKEN_GK_KEY_MAX 64 /* max GSSAPI key size */ -#define AFSTOKEN_GK_TOKEN_MAX 16384 /* max GSSAPI token size */ -#define AFSTOKEN_K5_COMPONENTS_MAX 16 /* max K5 components */ -#define AFSTOKEN_K5_NAME_MAX 128 /* max K5 name length */ -#define AFSTOKEN_K5_REALM_MAX 64 /* max K5 realm name length */ -#define AFSTOKEN_K5_TIX_MAX 16384 /* max K5 ticket size */ -#define AFSTOKEN_K5_ADDRESSES_MAX 16 /* max K5 addresses */ -#define AFSTOKEN_K5_AUTHDATA_MAX 16 /* max K5 pieces of auth data */ - #endif /* _KEYS_RXRPC_TYPE_H */ diff --git a/trunk/include/linux/igmp.h b/trunk/include/linux/igmp.h index fe158e0e20e6..92fbd8cbd68f 100644 --- a/trunk/include/linux/igmp.h +++ b/trunk/include/linux/igmp.h @@ -233,8 +233,6 @@ extern void ip_mc_init_dev(struct in_device *); extern void ip_mc_destroy_dev(struct in_device *); extern void ip_mc_up(struct in_device *); extern void ip_mc_down(struct in_device *); -extern void ip_mc_unmap(struct in_device *); -extern void ip_mc_remap(struct in_device *); extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); extern void ip_mc_rejoin_group(struct ip_mc_list *im); diff --git a/trunk/include/linux/net.h b/trunk/include/linux/net.h index 9040a10584f7..4fc2ffd527f9 100644 --- a/trunk/include/linux/net.h +++ b/trunk/include/linux/net.h @@ -57,7 +57,6 @@ typedef enum { #include #include #include /* For O_CLOEXEC and O_NONBLOCK */ -#include struct poll_table_struct; struct pipe_inode_info; @@ -128,11 +127,7 @@ enum sock_shutdown_cmd { */ struct socket { socket_state state; - - kmemcheck_bitfield_begin(type); short type; - kmemcheck_bitfield_end(type); - unsigned long flags; /* * Please keep fasync_list & wait fields in the same cache line diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index f46db6c7a734..65ee1929b2b1 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -1873,8 +1873,7 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct extern int dev_set_promiscuity(struct net_device *dev, int inc); extern int dev_set_allmulti(struct net_device *dev, int inc); extern void netdev_state_change(struct net_device *dev); -extern void netdev_bonding_change(struct net_device *dev, - unsigned long event); +extern void netdev_bonding_change(struct net_device *dev); extern void netdev_features_change(struct net_device *dev); /* Load a device via the kmod */ extern void dev_load(struct net *net, const char *name); diff --git a/trunk/include/linux/netlink.h b/trunk/include/linux/netlink.h index 080f6ba9e73a..0fbecbbe8e9e 100644 --- a/trunk/include/linux/netlink.h +++ b/trunk/include/linux/netlink.h @@ -176,16 +176,12 @@ struct netlink_skb_parms #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) -extern void netlink_table_grab(void); -extern void netlink_table_ungrab(void); - extern struct sock *netlink_kernel_create(struct net *net, int unit,unsigned int groups, void (*input)(struct sk_buff *skb), struct mutex *cb_mutex, struct module *module); extern void netlink_kernel_release(struct sock *sk); -extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); diff --git a/trunk/include/linux/notifier.h b/trunk/include/linux/notifier.h index 44428d247dbe..81bc252dc8ac 100644 --- a/trunk/include/linux/notifier.h +++ b/trunk/include/linux/notifier.h @@ -199,8 +199,6 @@ static inline int notifier_to_errno(int ret) #define NETDEV_FEAT_CHANGE 0x000B #define NETDEV_BONDING_FAILOVER 0x000C #define NETDEV_PRE_UP 0x000D -#define NETDEV_BONDING_OLDTYPE 0x000E -#define NETDEV_BONDING_NEWTYPE 0x000F #define SYS_DOWN 0x0001 /* Notify of system down */ #define SYS_RESTART SYS_DOWN diff --git a/trunk/include/linux/rxrpc.h b/trunk/include/linux/rxrpc.h index a53915cd5581..f7b826b565c7 100644 --- a/trunk/include/linux/rxrpc.h +++ b/trunk/include/linux/rxrpc.h @@ -58,12 +58,5 @@ struct sockaddr_rxrpc { #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ -/* - * RxRPC security indices - */ -#define RXRPC_SECURITY_NONE 0 /* no security protocol */ -#define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */ -#define RXRPC_SECURITY_RXGK 4 /* gssapi-based */ -#define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */ #endif /* _LINUX_RXRPC_H */ diff --git a/trunk/include/net/addrconf.h b/trunk/include/net/addrconf.h index 0f7c37825fc1..7b55ab215a64 100644 --- a/trunk/include/net/addrconf.h +++ b/trunk/include/net/addrconf.h @@ -143,8 +143,6 @@ extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); extern void ipv6_mc_up(struct inet6_dev *idev); extern void ipv6_mc_down(struct inet6_dev *idev); -extern void ipv6_mc_unmap(struct inet6_dev *idev); -extern void ipv6_mc_remap(struct inet6_dev *idev); extern void ipv6_mc_init_dev(struct inet6_dev *idev); extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); diff --git a/trunk/include/net/protocol.h b/trunk/include/net/protocol.h index 60249e51b669..1089d5aabd49 100644 --- a/trunk/include/net/protocol.h +++ b/trunk/include/net/protocol.h @@ -94,20 +94,21 @@ struct inet_protosw { #define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ -extern const struct net_protocol *inet_protos[MAX_INET_PROTOS]; +extern struct net_protocol *inet_protocol_base; +extern struct net_protocol *inet_protos[MAX_INET_PROTOS]; #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) -extern const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; +extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; #endif -extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); -extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); +extern int inet_add_protocol(struct net_protocol *prot, unsigned char num); +extern int inet_del_protocol(struct net_protocol *prot, unsigned char num); extern void inet_register_protosw(struct inet_protosw *p); extern void inet_unregister_protosw(struct inet_protosw *p); #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) -extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); -extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); +extern int inet6_add_protocol(struct inet6_protocol *prot, unsigned char num); +extern int inet6_del_protocol(struct inet6_protocol *prot, unsigned char num); extern int inet6_register_protosw(struct inet_protosw *p); extern void inet6_unregister_protosw(struct inet_protosw *p); #endif diff --git a/trunk/include/net/sch_generic.h b/trunk/include/net/sch_generic.h index c33180dd42b4..88eb9de095de 100644 --- a/trunk/include/net/sch_generic.h +++ b/trunk/include/net/sch_generic.h @@ -81,7 +81,7 @@ struct Qdisc struct Qdisc_class_ops { /* Child qdisc manipulation */ - struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); + unsigned int (*select_queue)(struct Qdisc *, struct tcmsg *); int (*graft)(struct Qdisc *, unsigned long cl, struct Qdisc *, struct Qdisc **); struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); diff --git a/trunk/include/net/tcp.h b/trunk/include/net/tcp.h index 56b76027b85e..b71a446d58f6 100644 --- a/trunk/include/net/tcp.h +++ b/trunk/include/net/tcp.h @@ -793,13 +793,6 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) return tp->packets_out - tcp_left_out(tp) + tp->retrans_out; } -#define TCP_INFINITE_SSTHRESH 0x7fffffff - -static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) -{ - return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; -} - /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. * The exception is rate halving phase, when cwnd is decreasing towards * ssthresh. diff --git a/trunk/net/appletalk/ddp.c b/trunk/net/appletalk/ddp.c index b1a4290996b5..4a6ff2ba4d07 100644 --- a/trunk/net/appletalk/ddp.c +++ b/trunk/net/appletalk/ddp.c @@ -1372,7 +1372,7 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev, if (aarp_send_ddp(rt->dev, skb, &ta, NULL) == NET_XMIT_DROP) return NET_RX_DROP; - return NET_RX_SUCCESS; + return NET_XMIT_SUCCESS; free_it: kfree_skb(skb); drop: diff --git a/trunk/net/can/af_can.c b/trunk/net/can/af_can.c index 606832115674..ef1c43a2ed56 100644 --- a/trunk/net/can/af_can.c +++ b/trunk/net/can/af_can.c @@ -199,8 +199,6 @@ static int can_create(struct net *net, struct socket *sock, int protocol) * @skb: pointer to socket buffer with CAN frame in data section * @loop: loopback for listeners on local CAN sockets (recommended default!) * - * Due to the loopback this routine must not be called from hardirq context. - * * Return: * 0 on success * -ENETDOWN when the selected interface is down @@ -280,7 +278,7 @@ int can_send(struct sk_buff *skb, int loop) } if (newskb) - netif_rx_ni(newskb); + netif_rx(newskb); /* update statistics */ can_stats.tx_frames++; diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 560c8c9c03ab..84945470ab38 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -1017,9 +1017,9 @@ void netdev_state_change(struct net_device *dev) } EXPORT_SYMBOL(netdev_state_change); -void netdev_bonding_change(struct net_device *dev, unsigned long event) +void netdev_bonding_change(struct net_device *dev) { - call_netdevice_notifiers(event, dev); + call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, dev); } EXPORT_SYMBOL(netdev_bonding_change); diff --git a/trunk/net/dccp/ccids/Kconfig b/trunk/net/dccp/ccids/Kconfig index 8408398cd44e..4b5db44970aa 100644 --- a/trunk/net/dccp/ccids/Kconfig +++ b/trunk/net/dccp/ccids/Kconfig @@ -66,9 +66,9 @@ config IP_DCCP_CCID3_RTO A value of 0 disables this feature by enforcing the value specified in RFC 3448. The following values have been suggested as bounds for experimental use: - * 16-20ms to match the typical multimedia inter-frame interval - * 100ms as a reasonable compromise [default] - * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4) + * 16-20ms to match the typical multimedia inter-frame interval + * 100ms as a reasonable compromise [default] + * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4) The default of 100ms is a compromise between a large value for efficient DCCP implementations, and a small value to avoid disrupting diff --git a/trunk/net/dccp/ccids/ccid2.c b/trunk/net/dccp/ccids/ccid2.c index e8cf99e880b0..d235294ace23 100644 --- a/trunk/net/dccp/ccids/ccid2.c +++ b/trunk/net/dccp/ccids/ccid2.c @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/ccid2.c + * * Copyright (c) 2005, 2006 Andrea Bittau * * Changes to meet Linux coding standards, and DCCP infrastructure fixes. diff --git a/trunk/net/dccp/ccids/ccid2.h b/trunk/net/dccp/ccids/ccid2.h index 326ac90fb909..2c94ca029010 100644 --- a/trunk/net/dccp/ccids/ccid2.h +++ b/trunk/net/dccp/ccids/ccid2.h @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/ccid2.h + * * Copyright (c) 2005 Andrea Bittau * * This program is free software; you can redistribute it and/or modify @@ -38,14 +40,14 @@ struct ccid2_seq { #define CCID2_SEQBUF_LEN 1024 #define CCID2_SEQBUF_MAX 128 -/** - * struct ccid2_hc_tx_sock - CCID2 TX half connection +/** struct ccid2_hc_tx_sock - CCID2 TX half connection + * * @ccid2hctx_{cwnd,ssthresh,pipe}: as per RFC 4341, section 5 * @ccid2hctx_packets_acked - Ack counter for deriving cwnd growth (RFC 3465) * @ccid2hctx_lastrtt -time RTT was last measured * @ccid2hctx_rpseq - last consecutive seqno * @ccid2hctx_rpdupack - dupacks since rpseq - */ +*/ struct ccid2_hc_tx_sock { u32 ccid2hctx_cwnd; u32 ccid2hctx_ssthresh; diff --git a/trunk/net/dccp/ccids/ccid3.c b/trunk/net/dccp/ccids/ccid3.c index 34dcc798c457..f596ce149c3c 100644 --- a/trunk/net/dccp/ccids/ccid3.c +++ b/trunk/net/dccp/ccids/ccid3.c @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/ccid3.c + * * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005-7 Ian McDonald @@ -748,8 +750,7 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) return 0; } -/** - * ccid3_first_li - Implements [RFC 5348, 6.3.1] +/** ccid3_first_li - Implements [RFC 3448, 6.3.1] * * Determine the length of the first loss interval via inverse lookup. * Assume that X_recv can be computed by the throughput equation diff --git a/trunk/net/dccp/ccids/ccid3.h b/trunk/net/dccp/ccids/ccid3.h index e5a244143846..49ca32bd7e79 100644 --- a/trunk/net/dccp/ccids/ccid3.h +++ b/trunk/net/dccp/ccids/ccid3.h @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/ccid3.h + * * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * @@ -73,8 +75,8 @@ enum ccid3_hc_tx_states { TFRC_SSTATE_TERM, }; -/** - * struct ccid3_hc_tx_sock - CCID3 sender half-connection socket +/** struct ccid3_hc_tx_sock - CCID3 sender half-connection socket + * * @ccid3hctx_x - Current sending rate in 64 * bytes per second * @ccid3hctx_x_recv - Receive rate in 64 * bytes per second * @ccid3hctx_x_calc - Calculated rate in bytes per second @@ -117,9 +119,9 @@ struct ccid3_hc_tx_sock { static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk) { - struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid); - BUG_ON(hctx == NULL); - return hctx; + struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid); + BUG_ON(hctx == NULL); + return hctx; } /* TFRC receiver states */ @@ -129,22 +131,22 @@ enum ccid3_hc_rx_states { TFRC_RSTATE_TERM = 127, }; -/** - * struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket - * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3) - * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard) - * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4) - * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1) - * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states - * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes - * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3) - * @ccid3hcrx_rtt - Receiver estimate of RTT - * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent - * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent - * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling) - * @ccid3hcrx_li_hist - Loss Interval database - * @ccid3hcrx_s - Received packet size in bytes - * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5) +/** struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket + * + * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3) + * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard) + * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4) + * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1) + * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states + * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes + * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3) + * @ccid3hcrx_rtt - Receiver estimate of RTT + * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent + * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent + * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling) + * @ccid3hcrx_li_hist - Loss Interval database + * @ccid3hcrx_s - Received packet size in bytes + * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5) */ struct ccid3_hc_rx_sock { u8 ccid3hcrx_last_counter:4; @@ -161,9 +163,9 @@ struct ccid3_hc_rx_sock { static inline struct ccid3_hc_rx_sock *ccid3_hc_rx_sk(const struct sock *sk) { - struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid); - BUG_ON(hcrx == NULL); - return hcrx; + struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid); + BUG_ON(hcrx == NULL); + return hcrx; } #endif /* _DCCP_CCID3_H_ */ diff --git a/trunk/net/dccp/ccids/lib/loss_interval.c b/trunk/net/dccp/ccids/lib/loss_interval.c index 8fc3cbf79071..4d1e40127264 100644 --- a/trunk/net/dccp/ccids/lib/loss_interval.c +++ b/trunk/net/dccp/ccids/lib/loss_interval.c @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/lib/loss_interval.c + * * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005-7 Ian McDonald @@ -19,7 +21,7 @@ static const int tfrc_lh_weights[NINTERVAL] = { 10, 10, 10, 10, 8, 6, 4, 2 }; /* implements LIFO semantics on the array */ static inline u8 LIH_INDEX(const u8 ctr) { - return LIH_SIZE - 1 - (ctr % LIH_SIZE); + return (LIH_SIZE - 1 - (ctr % LIH_SIZE)); } /* the `counter' index always points at the next entry to be populated */ @@ -127,8 +129,7 @@ static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur, (cur->li_is_closed || SUB16(new_loss->tfrchrx_ccval, cur->li_ccval) > 4); } -/** - * tfrc_lh_interval_add - Insert new record into the Loss Interval database +/** tfrc_lh_interval_add - Insert new record into the Loss Interval database * @lh: Loss Interval database * @rh: Receive history containing a fresh loss event * @calc_first_li: Caller-dependent routine to compute length of first interval diff --git a/trunk/net/dccp/ccids/lib/loss_interval.h b/trunk/net/dccp/ccids/lib/loss_interval.h index d1d2f5383b7d..246018a3b269 100644 --- a/trunk/net/dccp/ccids/lib/loss_interval.h +++ b/trunk/net/dccp/ccids/lib/loss_interval.h @@ -1,6 +1,8 @@ #ifndef _DCCP_LI_HIST_ #define _DCCP_LI_HIST_ /* + * net/dccp/ccids/lib/loss_interval.h + * * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005-7 Ian McDonald diff --git a/trunk/net/dccp/ccids/lib/packet_history.c b/trunk/net/dccp/ccids/lib/packet_history.c index 3a4f414e94a0..b7785b3581ec 100644 --- a/trunk/net/dccp/ccids/lib/packet_history.c +++ b/trunk/net/dccp/ccids/lib/packet_history.c @@ -1,4 +1,6 @@ /* + * net/dccp/packet_history.c + * * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * @@ -126,7 +128,7 @@ u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, const u64 seqno, /* - * Receiver History Routines + * Receiver History Routines */ static struct kmem_cache *tfrc_rx_hist_slab; diff --git a/trunk/net/dccp/ccids/lib/packet_history.h b/trunk/net/dccp/ccids/lib/packet_history.h index 7df6c5299999..461cc91cce88 100644 --- a/trunk/net/dccp/ccids/lib/packet_history.h +++ b/trunk/net/dccp/ccids/lib/packet_history.h @@ -70,6 +70,7 @@ struct tfrc_rx_hist_entry { /** * tfrc_rx_hist - RX history structure for TFRC-based protocols + * * @ring: Packet history for RTT sampling and loss detection * @loss_count: Number of entries in circular history * @loss_start: Movable index (for loss detection) diff --git a/trunk/net/dccp/ccids/lib/tfrc.h b/trunk/net/dccp/ccids/lib/tfrc.h index 01bb48e96c2e..e9720b143275 100644 --- a/trunk/net/dccp/ccids/lib/tfrc.h +++ b/trunk/net/dccp/ccids/lib/tfrc.h @@ -1,6 +1,8 @@ #ifndef _TFRC_H_ #define _TFRC_H_ /* + * net/dccp/ccids/lib/tfrc.h + * * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-6 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005-6 Ian McDonald @@ -30,7 +32,7 @@ extern int tfrc_debug; /* integer-arithmetic divisions of type (a * 1000000)/b */ static inline u64 scaled_div(u64 a, u64 b) { - BUG_ON(b == 0); + BUG_ON(b==0); return div64_u64(a * 1000000, b); } diff --git a/trunk/net/dccp/ccids/lib/tfrc_equation.c b/trunk/net/dccp/ccids/lib/tfrc_equation.c index 22ca1cf0eb55..c5d3a9e5a5a4 100644 --- a/trunk/net/dccp/ccids/lib/tfrc_equation.c +++ b/trunk/net/dccp/ccids/lib/tfrc_equation.c @@ -1,4 +1,6 @@ /* + * net/dccp/ccids/lib/tfrc_equation.c + * * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005 Ian McDonald * Copyright (c) 2005 Arnaldo Carvalho de Melo @@ -77,10 +79,10 @@ } With the given configuration, we have, with M = TFRC_CALC_X_ARRSIZE-1, - lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) - lookup[M][0] = g(1000000) = 1000000 * f(100%) - lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) - lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) + lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) + lookup[M][0] = g(1000000) = 1000000 * f(100%) + lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) + lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) In summary, the two columns represent f(p) for the following ranges: * The first column is for 0.002 <= p <= 1.0 @@ -608,10 +610,11 @@ static inline u32 tfrc_binsearch(u32 fval, u8 small) /** * tfrc_calc_x - Calculate the send rate as per section 3.1 of RFC3448 - * @s: packet size in bytes - * @R: RTT scaled by 1000000 (i.e., microseconds) - * @p: loss ratio estimate scaled by 1000000 - * Returns X_calc in bytes per second (not scaled). + * + * @s: packet size in bytes + * @R: RTT scaled by 1000000 (i.e., microseconds) + * @p: loss ratio estimate scaled by 1000000 + * Returns X_calc in bytes per second (not scaled). */ u32 tfrc_calc_x(u16 s, u32 R, u32 p) { @@ -627,17 +630,17 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p) return ~0U; } - if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ + if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ DCCP_WARN("Value of p (%d) below resolution. " "Substituting %d\n", p, TFRC_SMALLEST_P); index = 0; - } else /* 0.0001 <= p <= 0.05 */ + } else /* 0.0001 <= p <= 0.05 */ index = p/TFRC_SMALLEST_P - 1; f = tfrc_calc_x_lookup[index][1]; - } else { /* 0.05 < p <= 1.00 */ + } else { /* 0.05 < p <= 1.00 */ index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; f = tfrc_calc_x_lookup[index][0]; @@ -658,6 +661,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p) /** * tfrc_calc_x_reverse_lookup - try to find p given f(p) + * * @fvalue: function value to match, scaled by 1000000 * Returns closest match for p, also scaled by 1000000 */ diff --git a/trunk/net/dccp/ipv4.c b/trunk/net/dccp/ipv4.c index 7302e1498d46..d01c00de1ad0 100644 --- a/trunk/net/dccp/ipv4.c +++ b/trunk/net/dccp/ipv4.c @@ -948,7 +948,7 @@ static struct proto dccp_v4_prot = { #endif }; -static const struct net_protocol dccp_v4_protocol = { +static struct net_protocol dccp_v4_protocol = { .handler = dccp_v4_rcv, .err_handler = dccp_v4_err, .no_policy = 1, diff --git a/trunk/net/dccp/ipv6.c b/trunk/net/dccp/ipv6.c index e48ca5d45658..64f011cc4491 100644 --- a/trunk/net/dccp/ipv6.c +++ b/trunk/net/dccp/ipv6.c @@ -1152,13 +1152,13 @@ static struct proto dccp_v6_prot = { #endif }; -static const struct inet6_protocol dccp_v6_protocol = { +static struct inet6_protocol dccp_v6_protocol = { .handler = dccp_v6_rcv, .err_handler = dccp_v6_err, .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, }; -static const struct proto_ops inet6_dccp_ops = { +static struct proto_ops inet6_dccp_ops = { .family = PF_INET6, .owner = THIS_MODULE, .release = inet6_release, diff --git a/trunk/net/ieee802154/dgram.c b/trunk/net/ieee802154/dgram.c index 77ae6852b93d..51593a48f2dd 100644 --- a/trunk/net/ieee802154/dgram.c +++ b/trunk/net/ieee802154/dgram.c @@ -414,7 +414,7 @@ static int dgram_getsockopt(struct sock *sk, int level, int optname, } static int dgram_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, int __user optlen) + char __user *optval, int optlen) { struct dgram_sock *ro = dgram_sk(sk); int val; diff --git a/trunk/net/ieee802154/raw.c b/trunk/net/ieee802154/raw.c index 4681501aae93..13198859982e 100644 --- a/trunk/net/ieee802154/raw.c +++ b/trunk/net/ieee802154/raw.c @@ -244,7 +244,7 @@ static int raw_getsockopt(struct sock *sk, int level, int optname, } static int raw_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, int __user optlen) + char __user *optval, int optlen) { return -EOPNOTSUPP; } diff --git a/trunk/net/ipv4/af_inet.c b/trunk/net/ipv4/af_inet.c index 58c4b0f7c4aa..6c30a73f03f5 100644 --- a/trunk/net/ipv4/af_inet.c +++ b/trunk/net/ipv4/af_inet.c @@ -244,7 +244,7 @@ EXPORT_SYMBOL(build_ehash_secret); static inline int inet_netns_ok(struct net *net, int protocol) { int hash; - const struct net_protocol *ipprot; + struct net_protocol *ipprot; if (net_eq(net, &init_net)) return 1; @@ -1162,7 +1162,7 @@ EXPORT_SYMBOL(inet_sk_rebuild_header); static int inet_gso_send_check(struct sk_buff *skb) { struct iphdr *iph; - const struct net_protocol *ops; + struct net_protocol *ops; int proto; int ihl; int err = -EINVAL; @@ -1198,7 +1198,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features) { struct sk_buff *segs = ERR_PTR(-EINVAL); struct iphdr *iph; - const struct net_protocol *ops; + struct net_protocol *ops; int proto; int ihl; int id; @@ -1265,7 +1265,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features) static struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb) { - const struct net_protocol *ops; + struct net_protocol *ops; struct sk_buff **pp = NULL; struct sk_buff *p; struct iphdr *iph; @@ -1342,7 +1342,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head, static int inet_gro_complete(struct sk_buff *skb) { - const struct net_protocol *ops; + struct net_protocol *ops; struct iphdr *iph = ip_hdr(skb); int proto = iph->protocol & (MAX_INET_PROTOS - 1); int err = -ENOSYS; @@ -1427,13 +1427,13 @@ void snmp_mib_free(void *ptr[2]) EXPORT_SYMBOL_GPL(snmp_mib_free); #ifdef CONFIG_IP_MULTICAST -static const struct net_protocol igmp_protocol = { +static struct net_protocol igmp_protocol = { .handler = igmp_rcv, .netns_ok = 1, }; #endif -static const struct net_protocol tcp_protocol = { +static struct net_protocol tcp_protocol = { .handler = tcp_v4_rcv, .err_handler = tcp_v4_err, .gso_send_check = tcp_v4_gso_send_check, @@ -1444,7 +1444,7 @@ static const struct net_protocol tcp_protocol = { .netns_ok = 1, }; -static const struct net_protocol udp_protocol = { +static struct net_protocol udp_protocol = { .handler = udp_rcv, .err_handler = udp_err, .gso_send_check = udp4_ufo_send_check, @@ -1453,7 +1453,7 @@ static const struct net_protocol udp_protocol = { .netns_ok = 1, }; -static const struct net_protocol icmp_protocol = { +static struct net_protocol icmp_protocol = { .handler = icmp_rcv, .no_policy = 1, .netns_ok = 1, diff --git a/trunk/net/ipv4/ah4.c b/trunk/net/ipv4/ah4.c index 5c662703eb1e..e878e494296e 100644 --- a/trunk/net/ipv4/ah4.c +++ b/trunk/net/ipv4/ah4.c @@ -311,7 +311,7 @@ static const struct xfrm_type ah_type = .output = ah_output }; -static const struct net_protocol ah4_protocol = { +static struct net_protocol ah4_protocol = { .handler = xfrm4_rcv, .err_handler = ah4_err, .no_policy = 1, diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 07336c6201f0..3863c3a4223f 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -1087,12 +1087,6 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, case NETDEV_DOWN: ip_mc_down(in_dev); break; - case NETDEV_BONDING_OLDTYPE: - ip_mc_unmap(in_dev); - break; - case NETDEV_BONDING_NEWTYPE: - ip_mc_remap(in_dev); - break; case NETDEV_CHANGEMTU: if (inetdev_valid_mtu(dev->mtu)) break; diff --git a/trunk/net/ipv4/esp4.c b/trunk/net/ipv4/esp4.c index 12f7287e902d..18bb383ea393 100644 --- a/trunk/net/ipv4/esp4.c +++ b/trunk/net/ipv4/esp4.c @@ -615,7 +615,7 @@ static const struct xfrm_type esp_type = .output = esp_output }; -static const struct net_protocol esp4_protocol = { +static struct net_protocol esp4_protocol = { .handler = xfrm4_rcv, .err_handler = esp4_err, .no_policy = 1, diff --git a/trunk/net/ipv4/icmp.c b/trunk/net/ipv4/icmp.c index 5bc13fe816d1..97c410e84388 100644 --- a/trunk/net/ipv4/icmp.c +++ b/trunk/net/ipv4/icmp.c @@ -655,7 +655,7 @@ static void icmp_unreach(struct sk_buff *skb) struct iphdr *iph; struct icmphdr *icmph; int hash, protocol; - const struct net_protocol *ipprot; + struct net_protocol *ipprot; u32 info = 0; struct net *net; diff --git a/trunk/net/ipv4/igmp.c b/trunk/net/ipv4/igmp.c index d41e5de79a82..01b4284ed694 100644 --- a/trunk/net/ipv4/igmp.c +++ b/trunk/net/ipv4/igmp.c @@ -1298,28 +1298,6 @@ void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) } } -/* Device changing type */ - -void ip_mc_unmap(struct in_device *in_dev) -{ - struct ip_mc_list *i; - - ASSERT_RTNL(); - - for (i = in_dev->mc_list; i; i = i->next) - igmp_group_dropped(i); -} - -void ip_mc_remap(struct in_device *in_dev) -{ - struct ip_mc_list *i; - - ASSERT_RTNL(); - - for (i = in_dev->mc_list; i; i = i->next) - igmp_group_added(i); -} - /* Device going down */ void ip_mc_down(struct in_device *in_dev) diff --git a/trunk/net/ipv4/ip_gre.c b/trunk/net/ipv4/ip_gre.c index d9645c94a067..533afaadefd4 100644 --- a/trunk/net/ipv4/ip_gre.c +++ b/trunk/net/ipv4/ip_gre.c @@ -1288,7 +1288,7 @@ static void ipgre_fb_tunnel_init(struct net_device *dev) } -static const struct net_protocol ipgre_protocol = { +static struct net_protocol ipgre_protocol = { .handler = ipgre_rcv, .err_handler = ipgre_err, .netns_ok = 1, diff --git a/trunk/net/ipv4/ip_input.c b/trunk/net/ipv4/ip_input.c index 6c98b43badf4..db46b4b5b2b9 100644 --- a/trunk/net/ipv4/ip_input.c +++ b/trunk/net/ipv4/ip_input.c @@ -202,7 +202,7 @@ static int ip_local_deliver_finish(struct sk_buff *skb) { int protocol = ip_hdr(skb)->protocol; int hash, raw; - const struct net_protocol *ipprot; + struct net_protocol *ipprot; resubmit: raw = raw_local_deliver(skb, protocol); diff --git a/trunk/net/ipv4/ipcomp.c b/trunk/net/ipv4/ipcomp.c index 38fbf04150ae..3262ce06294c 100644 --- a/trunk/net/ipv4/ipcomp.c +++ b/trunk/net/ipv4/ipcomp.c @@ -146,7 +146,7 @@ static const struct xfrm_type ipcomp_type = { .output = ipcomp_output }; -static const struct net_protocol ipcomp4_protocol = { +static struct net_protocol ipcomp4_protocol = { .handler = xfrm4_rcv, .err_handler = ipcomp4_err, .no_policy = 1, diff --git a/trunk/net/ipv4/ipmr.c b/trunk/net/ipv4/ipmr.c index c43ec2d51ce2..65d421cf5bc7 100644 --- a/trunk/net/ipv4/ipmr.c +++ b/trunk/net/ipv4/ipmr.c @@ -99,6 +99,10 @@ static int ipmr_cache_report(struct net *net, struct sk_buff *pkt, vifi_t vifi, int assert); static int ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm); +#ifdef CONFIG_IP_PIMSM_V2 +static struct net_protocol pim_protocol; +#endif + static struct timer_list ipmr_expire_timer; /* Service routines creating virtual interfaces: DVMRP tunnels and PIMREG */ @@ -1941,7 +1945,7 @@ static const struct file_operations ipmr_mfc_fops = { #endif #ifdef CONFIG_IP_PIMSM_V2 -static const struct net_protocol pim_protocol = { +static struct net_protocol pim_protocol = { .handler = pim_rcv, .netns_ok = 1, }; diff --git a/trunk/net/ipv4/protocol.c b/trunk/net/ipv4/protocol.c index 542f22fc98b3..a2e5fc0a15e1 100644 --- a/trunk/net/ipv4/protocol.c +++ b/trunk/net/ipv4/protocol.c @@ -28,14 +28,14 @@ #include #include -const struct net_protocol *inet_protos[MAX_INET_PROTOS] ____cacheline_aligned_in_smp; +struct net_protocol *inet_protos[MAX_INET_PROTOS] ____cacheline_aligned_in_smp; static DEFINE_SPINLOCK(inet_proto_lock); /* * Add a protocol handler to the hash tables */ -int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol) +int inet_add_protocol(struct net_protocol *prot, unsigned char protocol) { int hash, ret; @@ -57,7 +57,7 @@ int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol) * Remove a protocol from the hash tables. */ -int inet_del_protocol(const struct net_protocol *prot, unsigned char protocol) +int inet_del_protocol(struct net_protocol *prot, unsigned char protocol) { int hash, ret; diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 19a0612b8a20..edeea060db44 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -2012,7 +2012,7 @@ int tcp_disconnect(struct sock *sk, int flags) tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; tp->packets_out = 0; - tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; + tp->snd_ssthresh = 0x7fffffff; tp->snd_cwnd_cnt = 0; tp->bytes_acked = 0; tcp_set_ca_state(sk, TCP_CA_Open); diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index d86784be7ab3..af6d6fa00db1 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -761,7 +761,7 @@ void tcp_update_metrics(struct sock *sk) set_dst_metric_rtt(dst, RTAX_RTTVAR, var); } - if (tcp_in_initial_slowstart(tp)) { + if (tp->snd_ssthresh >= 0xFFFF) { /* Slow start still did not finish. */ if (dst_metric(dst, RTAX_SSTHRESH) && !dst_metric_locked(dst, RTAX_SSTHRESH) && diff --git a/trunk/net/ipv4/tcp_ipv4.c b/trunk/net/ipv4/tcp_ipv4.c index 7cda24b53f61..0543561da999 100644 --- a/trunk/net/ipv4/tcp_ipv4.c +++ b/trunk/net/ipv4/tcp_ipv4.c @@ -1808,7 +1808,7 @@ static int tcp_v4_init_sock(struct sock *sk) /* See draft-stevens-tcpca-spec-01 for discussion of the * initialization of these values. */ - tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; + tp->snd_ssthresh = 0x7fffffff; /* Infinity */ tp->snd_cwnd_clamp = ~0; tp->mss_cache = 536; @@ -2284,7 +2284,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len) jiffies_to_clock_t(icsk->icsk_ack.ato), (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong, tp->snd_cwnd, - tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh, + tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh, len); } diff --git a/trunk/net/ipv4/tcp_minisocks.c b/trunk/net/ipv4/tcp_minisocks.c index 624c3c9b3c2b..e48c37d74d77 100644 --- a/trunk/net/ipv4/tcp_minisocks.c +++ b/trunk/net/ipv4/tcp_minisocks.c @@ -363,7 +363,7 @@ void tcp_twsk_destructor(struct sock *sk) #ifdef CONFIG_TCP_MD5SIG struct tcp_timewait_sock *twsk = tcp_twsk(sk); if (twsk->tw_md5_keylen) - tcp_free_md5sig_pool(); + tcp_put_md5sig_pool(); #endif } @@ -410,7 +410,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, newtp->retrans_out = 0; newtp->sacked_out = 0; newtp->fackets_out = 0; - newtp->snd_ssthresh = TCP_INFINITE_SSTHRESH; + newtp->snd_ssthresh = 0x7fffffff; /* So many TCP implementations out there (incorrectly) count the * initial SYN frame in their delayed-ACK and congestion control diff --git a/trunk/net/ipv4/tunnel4.c b/trunk/net/ipv4/tunnel4.c index 3959e0ca456a..cb1f0e83830b 100644 --- a/trunk/net/ipv4/tunnel4.c +++ b/trunk/net/ipv4/tunnel4.c @@ -132,7 +132,7 @@ static void tunnel64_err(struct sk_buff *skb, u32 info) } #endif -static const struct net_protocol tunnel4_protocol = { +static struct net_protocol tunnel4_protocol = { .handler = tunnel4_rcv, .err_handler = tunnel4_err, .no_policy = 1, @@ -140,7 +140,7 @@ static const struct net_protocol tunnel4_protocol = { }; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -static const struct net_protocol tunnel64_protocol = { +static struct net_protocol tunnel64_protocol = { .handler = tunnel64_rcv, .err_handler = tunnel64_err, .no_policy = 1, diff --git a/trunk/net/ipv4/udplite.c b/trunk/net/ipv4/udplite.c index 95248d7f75ec..c784891cb7e5 100644 --- a/trunk/net/ipv4/udplite.c +++ b/trunk/net/ipv4/udplite.c @@ -25,7 +25,7 @@ static void udplite_err(struct sk_buff *skb, u32 info) __udp4_lib_err(skb, info, &udplite_table); } -static const struct net_protocol udplite_protocol = { +static struct net_protocol udplite_protocol = { .handler = udplite_rcv, .err_handler = udplite_err, .no_policy = 1, diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index f216a41ceb22..c9b369034a40 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -137,8 +137,6 @@ static DEFINE_SPINLOCK(addrconf_verify_lock); static void addrconf_join_anycast(struct inet6_ifaddr *ifp); static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); -static void addrconf_bonding_change(struct net_device *dev, - unsigned long event); static int addrconf_ifdown(struct net_device *dev, int how); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); @@ -2584,10 +2582,6 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, return notifier_from_errno(err); } break; - case NETDEV_BONDING_OLDTYPE: - case NETDEV_BONDING_NEWTYPE: - addrconf_bonding_change(dev, event); - break; } return NOTIFY_OK; @@ -2601,19 +2595,6 @@ static struct notifier_block ipv6_dev_notf = { .priority = 0 }; -static void addrconf_bonding_change(struct net_device *dev, unsigned long event) -{ - struct inet6_dev *idev; - ASSERT_RTNL(); - - idev = __in6_dev_get(dev); - - if (event == NETDEV_BONDING_NEWTYPE) - ipv6_mc_remap(idev); - else if (event == NETDEV_BONDING_OLDTYPE) - ipv6_mc_unmap(idev); -} - static int addrconf_ifdown(struct net_device *dev, int how) { struct inet6_dev *idev; diff --git a/trunk/net/ipv6/af_inet6.c b/trunk/net/ipv6/af_inet6.c index e127a32f9540..a123a328aeb3 100644 --- a/trunk/net/ipv6/af_inet6.c +++ b/trunk/net/ipv6/af_inet6.c @@ -710,7 +710,7 @@ EXPORT_SYMBOL_GPL(ipv6_opt_accepted); static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) { - const struct inet6_protocol *ops = NULL; + struct inet6_protocol *ops = NULL; for (;;) { struct ipv6_opt_hdr *opth; @@ -745,7 +745,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) static int ipv6_gso_send_check(struct sk_buff *skb) { struct ipv6hdr *ipv6h; - const struct inet6_protocol *ops; + struct inet6_protocol *ops; int err = -EINVAL; if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h)))) @@ -773,7 +773,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features) { struct sk_buff *segs = ERR_PTR(-EINVAL); struct ipv6hdr *ipv6h; - const struct inet6_protocol *ops; + struct inet6_protocol *ops; int proto; struct frag_hdr *fptr; unsigned int unfrag_ip6hlen; @@ -840,7 +840,7 @@ struct ipv6_gro_cb { static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, struct sk_buff *skb) { - const struct inet6_protocol *ops; + struct inet6_protocol *ops; struct sk_buff **pp = NULL; struct sk_buff *p; struct ipv6hdr *iph; @@ -926,7 +926,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, static int ipv6_gro_complete(struct sk_buff *skb) { - const struct inet6_protocol *ops; + struct inet6_protocol *ops; struct ipv6hdr *iph = ipv6_hdr(skb); int err = -ENOSYS; diff --git a/trunk/net/ipv6/ah6.c b/trunk/net/ipv6/ah6.c index c1589e2f1dc9..86f42a288c4b 100644 --- a/trunk/net/ipv6/ah6.c +++ b/trunk/net/ipv6/ah6.c @@ -527,7 +527,7 @@ static const struct xfrm_type ah6_type = .hdr_offset = xfrm6_find_1stfragopt, }; -static const struct inet6_protocol ah6_protocol = { +static struct inet6_protocol ah6_protocol = { .handler = xfrm6_rcv, .err_handler = ah6_err, .flags = INET6_PROTO_NOPOLICY, diff --git a/trunk/net/ipv6/esp6.c b/trunk/net/ipv6/esp6.c index af597c73ebe9..678bb95b1525 100644 --- a/trunk/net/ipv6/esp6.c +++ b/trunk/net/ipv6/esp6.c @@ -558,7 +558,7 @@ static const struct xfrm_type esp6_type = .hdr_offset = xfrm6_find_1stfragopt, }; -static const struct inet6_protocol esp6_protocol = { +static struct inet6_protocol esp6_protocol = { .handler = xfrm6_rcv, .err_handler = esp6_err, .flags = INET6_PROTO_NOPOLICY, diff --git a/trunk/net/ipv6/exthdrs.c b/trunk/net/ipv6/exthdrs.c index df159fffe4bc..4aae658e5501 100644 --- a/trunk/net/ipv6/exthdrs.c +++ b/trunk/net/ipv6/exthdrs.c @@ -500,17 +500,17 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb) return -1; } -static const struct inet6_protocol rthdr_protocol = { +static struct inet6_protocol rthdr_protocol = { .handler = ipv6_rthdr_rcv, .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR, }; -static const struct inet6_protocol destopt_protocol = { +static struct inet6_protocol destopt_protocol = { .handler = ipv6_destopt_rcv, .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR, }; -static const struct inet6_protocol nodata_protocol = { +static struct inet6_protocol nodata_protocol = { .handler = dst_discard, .flags = INET6_PROTO_NOPOLICY, }; diff --git a/trunk/net/ipv6/icmp.c b/trunk/net/ipv6/icmp.c index f23ebbec0631..e2325f6a05fb 100644 --- a/trunk/net/ipv6/icmp.c +++ b/trunk/net/ipv6/icmp.c @@ -86,7 +86,7 @@ static inline struct sock *icmpv6_sk(struct net *net) static int icmpv6_rcv(struct sk_buff *skb); -static const struct inet6_protocol icmpv6_protocol = { +static struct inet6_protocol icmpv6_protocol = { .handler = icmpv6_rcv, .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, }; @@ -583,7 +583,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info) { - const struct inet6_protocol *ipprot; + struct inet6_protocol *ipprot; int inner_offset; int hash; u8 nexthdr; diff --git a/trunk/net/ipv6/ip6_input.c b/trunk/net/ipv6/ip6_input.c index 237e2dba6e94..2d9cbaa67edb 100644 --- a/trunk/net/ipv6/ip6_input.c +++ b/trunk/net/ipv6/ip6_input.c @@ -159,7 +159,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt static int ip6_input_finish(struct sk_buff *skb) { - const struct inet6_protocol *ipprot; + struct inet6_protocol *ipprot; unsigned int nhoff; int nexthdr, raw; u8 hash; diff --git a/trunk/net/ipv6/ip6mr.c b/trunk/net/ipv6/ip6mr.c index 3907510c2ce3..5c8d73730c75 100644 --- a/trunk/net/ipv6/ip6mr.c +++ b/trunk/net/ipv6/ip6mr.c @@ -83,6 +83,10 @@ static int ip6mr_cache_report(struct net *net, struct sk_buff *pkt, static int ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm); static void mroute_clean_tables(struct net *net); +#ifdef CONFIG_IPV6_PIMSM_V2 +static struct inet6_protocol pim6_protocol; +#endif + static struct timer_list ipmr_expire_timer; @@ -406,7 +410,7 @@ static int pim6_rcv(struct sk_buff *skb) return 0; } -static const struct inet6_protocol pim6_protocol = { +static struct inet6_protocol pim6_protocol = { .handler = pim6_rcv, }; diff --git a/trunk/net/ipv6/ipcomp6.c b/trunk/net/ipv6/ipcomp6.c index 2f2a5ca2c878..79c172f1ff01 100644 --- a/trunk/net/ipv6/ipcomp6.c +++ b/trunk/net/ipv6/ipcomp6.c @@ -178,7 +178,7 @@ static const struct xfrm_type ipcomp6_type = .hdr_offset = xfrm6_find_1stfragopt, }; -static const struct inet6_protocol ipcomp6_protocol = +static struct inet6_protocol ipcomp6_protocol = { .handler = xfrm6_rcv, .err_handler = ipcomp6_err, diff --git a/trunk/net/ipv6/mcast.c b/trunk/net/ipv6/mcast.c index f9fcf690bd5d..71c3dacec1ed 100644 --- a/trunk/net/ipv6/mcast.c +++ b/trunk/net/ipv6/mcast.c @@ -2249,25 +2249,6 @@ static void igmp6_timer_handler(unsigned long data) ma_put(ma); } -/* Device changing type */ - -void ipv6_mc_unmap(struct inet6_dev *idev) -{ - struct ifmcaddr6 *i; - - /* Install multicast list, except for all-nodes (already installed) */ - - read_lock_bh(&idev->lock); - for (i = idev->mc_list; i; i = i->next) - igmp6_group_dropped(i); - read_unlock_bh(&idev->lock); -} - -void ipv6_mc_remap(struct inet6_dev *idev) -{ - ipv6_mc_up(idev); -} - /* Device going down */ void ipv6_mc_down(struct inet6_dev *idev) diff --git a/trunk/net/ipv6/protocol.c b/trunk/net/ipv6/protocol.c index 1fa3468f0f32..568864f722ca 100644 --- a/trunk/net/ipv6/protocol.c +++ b/trunk/net/ipv6/protocol.c @@ -25,11 +25,11 @@ #include #include -const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; +struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; static DEFINE_SPINLOCK(inet6_proto_lock); -int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char protocol) +int inet6_add_protocol(struct inet6_protocol *prot, unsigned char protocol) { int ret, hash = protocol & (MAX_INET_PROTOS - 1); @@ -53,7 +53,7 @@ EXPORT_SYMBOL(inet6_add_protocol); * Remove a protocol from the hash tables. */ -int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char protocol) +int inet6_del_protocol(struct inet6_protocol *prot, unsigned char protocol) { int ret, hash = protocol & (MAX_INET_PROTOS - 1); diff --git a/trunk/net/ipv6/reassembly.c b/trunk/net/ipv6/reassembly.c index da5bd0ed83df..2642a41a8535 100644 --- a/trunk/net/ipv6/reassembly.c +++ b/trunk/net/ipv6/reassembly.c @@ -627,7 +627,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) return -1; } -static const struct inet6_protocol frag_protocol = +static struct inet6_protocol frag_protocol = { .handler = ipv6_frag_rcv, .flags = INET6_PROTO_NOPOLICY, diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index 77aecbe8ff6c..9ccfef345560 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -481,7 +481,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, pref = rinfo->route_pref; if (pref == ICMPV6_ROUTER_PREF_INVALID) - return -EINVAL; + pref = ICMPV6_ROUTER_PREF_MEDIUM; lifetime = addrconf_timeout_fixup(ntohl(rinfo->lifetime), HZ); diff --git a/trunk/net/ipv6/tcp_ipv6.c b/trunk/net/ipv6/tcp_ipv6.c index 21d100b68b19..3aae0f217d61 100644 --- a/trunk/net/ipv6/tcp_ipv6.c +++ b/trunk/net/ipv6/tcp_ipv6.c @@ -1846,7 +1846,7 @@ static int tcp_v6_init_sock(struct sock *sk) /* See draft-stevens-tcpca-spec-01 for discussion of the * initialization of these values. */ - tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; + tp->snd_ssthresh = 0x7fffffff; tp->snd_cwnd_clamp = ~0; tp->mss_cache = 536; @@ -1969,8 +1969,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) jiffies_to_clock_t(icsk->icsk_rto), jiffies_to_clock_t(icsk->icsk_ack.ato), (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong, - tp->snd_cwnd, - tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh + tp->snd_cwnd, tp->snd_ssthresh>=0xFFFF?-1:tp->snd_ssthresh ); } @@ -2094,7 +2093,7 @@ struct proto tcpv6_prot = { #endif }; -static const struct inet6_protocol tcpv6_protocol = { +static struct inet6_protocol tcpv6_protocol = { .handler = tcp_v6_rcv, .err_handler = tcp_v6_err, .gso_send_check = tcp_v6_gso_send_check, diff --git a/trunk/net/ipv6/tunnel6.c b/trunk/net/ipv6/tunnel6.c index 51e2832d13a6..633ad789effc 100644 --- a/trunk/net/ipv6/tunnel6.c +++ b/trunk/net/ipv6/tunnel6.c @@ -133,13 +133,13 @@ static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, break; } -static const struct inet6_protocol tunnel6_protocol = { +static struct inet6_protocol tunnel6_protocol = { .handler = tunnel6_rcv, .err_handler = tunnel6_err, .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, }; -static const struct inet6_protocol tunnel46_protocol = { +static struct inet6_protocol tunnel46_protocol = { .handler = tunnel46_rcv, .err_handler = tunnel6_err, .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, diff --git a/trunk/net/ipv6/udp.c b/trunk/net/ipv6/udp.c index b265b7047d3e..164040613c2e 100644 --- a/trunk/net/ipv6/udp.c +++ b/trunk/net/ipv6/udp.c @@ -1172,7 +1172,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, int features) return segs; } -static const struct inet6_protocol udpv6_protocol = { +static struct inet6_protocol udpv6_protocol = { .handler = udpv6_rcv, .err_handler = udpv6_err, .gso_send_check = udp6_ufo_send_check, diff --git a/trunk/net/ipv6/udplite.c b/trunk/net/ipv6/udplite.c index d737a27ee010..4818c48688f2 100644 --- a/trunk/net/ipv6/udplite.c +++ b/trunk/net/ipv6/udplite.c @@ -25,7 +25,7 @@ static void udplitev6_err(struct sk_buff *skb, __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table); } -static const struct inet6_protocol udplitev6_protocol = { +static struct inet6_protocol udplitev6_protocol = { .handler = udplitev6_rcv, .err_handler = udplitev6_err, .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, diff --git a/trunk/net/iucv/af_iucv.c b/trunk/net/iucv/af_iucv.c index 3c915fb42917..49c15b48408e 100644 --- a/trunk/net/iucv/af_iucv.c +++ b/trunk/net/iucv/af_iucv.c @@ -34,7 +34,7 @@ static char iucv_userid[80]; -static const struct proto_ops iucv_sock_ops; +static struct proto_ops iucv_sock_ops; static struct proto iucv_proto = { .name = "AF_IUCV", @@ -1682,7 +1682,7 @@ static void iucv_callback_shutdown(struct iucv_path *path, u8 ipuser[16]) bh_unlock_sock(sk); } -static const struct proto_ops iucv_sock_ops = { +static struct proto_ops iucv_sock_ops = { .family = PF_IUCV, .owner = THIS_MODULE, .release = iucv_sock_release, diff --git a/trunk/net/mac80211/rc80211_minstrel.c b/trunk/net/mac80211/rc80211_minstrel.c index 6e5d68b4e427..7c5142988bbb 100644 --- a/trunk/net/mac80211/rc80211_minstrel.c +++ b/trunk/net/mac80211/rc80211_minstrel.c @@ -418,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, /* contention window */ tx_time_single += t_slot + min(cw, mp->cw_max); - cw = (cw << 1) | 1; + cw = (cw + 1) << 1; tx_time += tx_time_single; tx_time_cts += tx_time_single + mi->sp_ack_dur; diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index c5aab6a368ce..d0ff382c40ca 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -177,11 +177,9 @@ static void netlink_sock_destruct(struct sock *sk) * this, _but_ remember, it adds useless work on UP machines. */ -void netlink_table_grab(void) +static void netlink_table_grab(void) __acquires(nl_table_lock) { - might_sleep(); - write_lock_irq(&nl_table_lock); if (atomic_read(&nl_table_users)) { @@ -202,7 +200,7 @@ void netlink_table_grab(void) } } -void netlink_table_ungrab(void) +static void netlink_table_ungrab(void) __releases(nl_table_lock) { write_unlock_irq(&nl_table_lock); @@ -1551,21 +1549,37 @@ static void netlink_free_old_listeners(struct rcu_head *rcu_head) kfree(lrh->ptr); } -int __netlink_change_ngroups(struct sock *sk, unsigned int groups) +/** + * netlink_change_ngroups - change number of multicast groups + * + * This changes the number of multicast groups that are available + * on a certain netlink family. Note that it is not possible to + * change the number of groups to below 32. Also note that it does + * not implicitly call netlink_clear_multicast_users() when the + * number of groups is reduced. + * + * @sk: The kernel netlink socket, as returned by netlink_kernel_create(). + * @groups: The new number of groups. + */ +int netlink_change_ngroups(struct sock *sk, unsigned int groups) { unsigned long *listeners, *old = NULL; struct listeners_rcu_head *old_rcu_head; struct netlink_table *tbl = &nl_table[sk->sk_protocol]; + int err = 0; if (groups < 32) groups = 32; + netlink_table_grab(); if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) { listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head), GFP_ATOMIC); - if (!listeners) - return -ENOMEM; + if (!listeners) { + err = -ENOMEM; + goto out_ungrab; + } old = tbl->listeners; memcpy(listeners, old, NLGRPSZ(tbl->groups)); rcu_assign_pointer(tbl->listeners, listeners); @@ -1583,29 +1597,8 @@ int __netlink_change_ngroups(struct sock *sk, unsigned int groups) } tbl->groups = groups; - return 0; -} - -/** - * netlink_change_ngroups - change number of multicast groups - * - * This changes the number of multicast groups that are available - * on a certain netlink family. Note that it is not possible to - * change the number of groups to below 32. Also note that it does - * not implicitly call netlink_clear_multicast_users() when the - * number of groups is reduced. - * - * @sk: The kernel netlink socket, as returned by netlink_kernel_create(). - * @groups: The new number of groups. - */ -int netlink_change_ngroups(struct sock *sk, unsigned int groups) -{ - int err; - - netlink_table_grab(); - err = __netlink_change_ngroups(sk, groups); + out_ungrab: netlink_table_ungrab(); - return err; } diff --git a/trunk/net/netlink/genetlink.c b/trunk/net/netlink/genetlink.c index 566941e03363..66f6ba0bab11 100644 --- a/trunk/net/netlink/genetlink.c +++ b/trunk/net/netlink/genetlink.c @@ -176,10 +176,9 @@ int genl_register_mc_group(struct genl_family *family, if (family->netnsok) { struct net *net; - netlink_table_grab(); rcu_read_lock(); for_each_net_rcu(net) { - err = __netlink_change_ngroups(net->genl_sock, + err = netlink_change_ngroups(net->genl_sock, mc_groups_longs * BITS_PER_LONG); if (err) { /* @@ -189,12 +188,10 @@ int genl_register_mc_group(struct genl_family *family, * increased on some sockets which is ok. */ rcu_read_unlock(); - netlink_table_ungrab(); goto out; } } rcu_read_unlock(); - netlink_table_ungrab(); } else { err = netlink_change_ngroups(init_net.genl_sock, mc_groups_longs * BITS_PER_LONG); diff --git a/trunk/net/phonet/pn_dev.c b/trunk/net/phonet/pn_dev.c index 5f42f30dd168..2f65dcaed2fb 100644 --- a/trunk/net/phonet/pn_dev.c +++ b/trunk/net/phonet/pn_dev.c @@ -209,14 +209,7 @@ static int phonet_device_autoconf(struct net_device *dev) SIOCPNGAUTOCONF); if (ret < 0) return ret; - - ASSERT_RTNL(); - ret = phonet_address_add(dev, req.ifr_phonet_autoconf.device); - if (ret) - return ret; - phonet_address_notify(RTM_NEWADDR, dev, - req.ifr_phonet_autoconf.device); - return 0; + return phonet_address_add(dev, req.ifr_phonet_autoconf.device); } /* notify Phonet of device events */ diff --git a/trunk/net/rds/af_rds.c b/trunk/net/rds/af_rds.c index 6b58aeff4c7a..108ed2e671c5 100644 --- a/trunk/net/rds/af_rds.c +++ b/trunk/net/rds/af_rds.c @@ -359,7 +359,7 @@ static struct proto rds_proto = { .obj_size = sizeof(struct rds_sock), }; -static const struct proto_ops rds_proto_ops = { +static struct proto_ops rds_proto_ops = { .family = AF_RDS, .owner = THIS_MODULE, .release = rds_release, diff --git a/trunk/net/rose/af_rose.c b/trunk/net/rose/af_rose.c index 1e166c9685aa..e5f478ca3d61 100644 --- a/trunk/net/rose/af_rose.c +++ b/trunk/net/rose/af_rose.c @@ -63,7 +63,7 @@ int sysctl_rose_window_size = ROSE_DEFAULT_WINDOW_SIZE; static HLIST_HEAD(rose_list); static DEFINE_SPINLOCK(rose_list_lock); -static const struct proto_ops rose_proto_ops; +static struct proto_ops rose_proto_ops; ax25_address rose_callsign; @@ -1515,7 +1515,7 @@ static struct net_proto_family rose_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops rose_proto_ops = { +static struct proto_ops rose_proto_ops = { .family = PF_ROSE, .owner = THIS_MODULE, .release = rose_release, diff --git a/trunk/net/rxrpc/ar-ack.c b/trunk/net/rxrpc/ar-ack.c index b4a220977031..c9f1f0a3a2ff 100644 --- a/trunk/net/rxrpc/ar-ack.c +++ b/trunk/net/rxrpc/ar-ack.c @@ -40,7 +40,7 @@ static const s8 rxrpc_ack_priority[] = { /* * propose an ACK be sent */ -void __rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason, +void __rxrpc_propose_ACK(struct rxrpc_call *call, uint8_t ack_reason, __be32 serial, bool immediate) { unsigned long expiry; @@ -120,7 +120,7 @@ void __rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason, /* * propose an ACK be sent, locking the call structure */ -void rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason, +void rxrpc_propose_ACK(struct rxrpc_call *call, uint8_t ack_reason, __be32 serial, bool immediate) { s8 prior = rxrpc_ack_priority[ack_reason]; @@ -520,7 +520,7 @@ static void rxrpc_zap_tx_window(struct rxrpc_call *call) struct rxrpc_skb_priv *sp; struct sk_buff *skb; unsigned long _skb, *acks_window; - u8 winsz = call->acks_winsz; + uint8_t winsz = call->acks_winsz; int tail; acks_window = call->acks_window; diff --git a/trunk/net/rxrpc/ar-internal.h b/trunk/net/rxrpc/ar-internal.h index 7043b294bb67..3e7318c1343c 100644 --- a/trunk/net/rxrpc/ar-internal.h +++ b/trunk/net/rxrpc/ar-internal.h @@ -229,7 +229,7 @@ struct rxrpc_conn_bundle { int debug_id; /* debug ID for printks */ unsigned short num_conns; /* number of connections in this bundle */ __be16 service_id; /* service ID */ - u8 security_ix; /* security type */ + uint8_t security_ix; /* security type */ }; /* @@ -370,10 +370,10 @@ struct rxrpc_call { u8 channel; /* connection channel occupied by this call */ /* transmission-phase ACK management */ - u8 acks_head; /* offset into window of first entry */ - u8 acks_tail; /* offset into window of last entry */ - u8 acks_winsz; /* size of un-ACK'd window */ - u8 acks_unacked; /* lowest unacked packet in last ACK received */ + uint8_t acks_head; /* offset into window of first entry */ + uint8_t acks_tail; /* offset into window of last entry */ + uint8_t acks_winsz; /* size of un-ACK'd window */ + uint8_t acks_unacked; /* lowest unacked packet in last ACK received */ int acks_latest; /* serial number of latest ACK received */ rxrpc_seq_t acks_hard; /* highest definitively ACK'd msg seq */ unsigned long *acks_window; /* sent packet window @@ -388,7 +388,7 @@ struct rxrpc_call { rxrpc_seq_t rx_first_oos; /* first packet in rx_oos_queue (or 0) */ rxrpc_seq_t ackr_win_top; /* top of ACK window (rx_data_eaten is bottom) */ rxrpc_seq_net_t ackr_prev_seq; /* previous sequence number received */ - u8 ackr_reason; /* reason to ACK */ + uint8_t ackr_reason; /* reason to ACK */ __be32 ackr_serial; /* serial of packet being ACK'd */ atomic_t ackr_not_idle; /* number of packets in Rx queue */ @@ -401,6 +401,22 @@ struct rxrpc_call { __be32 call_id; /* call ID on connection */ }; +/* + * RxRPC key for Kerberos (type-2 security) + */ +struct rxkad_key { + u16 security_index; /* RxRPC header security index */ + u16 ticket_len; /* length of ticket[] */ + u32 expiry; /* time at which expires */ + u32 kvno; /* key version number */ + u8 session_key[8]; /* DES session key */ + u8 ticket[0]; /* the encrypted ticket */ +}; + +struct rxrpc_key_payload { + struct rxkad_key k; +}; + /* * locally abort an RxRPC call */ @@ -434,8 +450,8 @@ extern int rxrpc_reject_call(struct rxrpc_sock *); /* * ar-ack.c */ -extern void __rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool); -extern void rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool); +extern void __rxrpc_propose_ACK(struct rxrpc_call *, uint8_t, __be32, bool); +extern void rxrpc_propose_ACK(struct rxrpc_call *, uint8_t, __be32, bool); extern void rxrpc_process_call(struct work_struct *); /* diff --git a/trunk/net/rxrpc/ar-key.c b/trunk/net/rxrpc/ar-key.c index 74697b200496..ad8c7a782da1 100644 --- a/trunk/net/rxrpc/ar-key.c +++ b/trunk/net/rxrpc/ar-key.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -29,7 +28,6 @@ static int rxrpc_instantiate_s(struct key *, const void *, size_t); static void rxrpc_destroy(struct key *); static void rxrpc_destroy_s(struct key *); static void rxrpc_describe(const struct key *, struct seq_file *); -static long rxrpc_read(const struct key *, char __user *, size_t); /* * rxrpc defined keys take an arbitrary string as the description and an @@ -41,7 +39,6 @@ struct key_type key_type_rxrpc = { .match = user_match, .destroy = rxrpc_destroy, .describe = rxrpc_describe, - .read = rxrpc_read, }; EXPORT_SYMBOL(key_type_rxrpc); @@ -57,595 +54,6 @@ struct key_type key_type_rxrpc_s = { .describe = rxrpc_describe, }; -/* - * parse an RxKAD type XDR format token - * - the caller guarantees we have at least 4 words - */ -static int rxrpc_instantiate_xdr_rxkad(struct key *key, const __be32 *xdr, - unsigned toklen) -{ - struct rxrpc_key_token *token, **pptoken; - size_t plen; - u32 tktlen; - int ret; - - _enter(",{%x,%x,%x,%x},%u", - ntohl(xdr[0]), ntohl(xdr[1]), ntohl(xdr[2]), ntohl(xdr[3]), - toklen); - - if (toklen <= 8 * 4) - return -EKEYREJECTED; - tktlen = ntohl(xdr[7]); - _debug("tktlen: %x", tktlen); - if (tktlen > AFSTOKEN_RK_TIX_MAX) - return -EKEYREJECTED; - if (8 * 4 + tktlen != toklen) - return -EKEYREJECTED; - - plen = sizeof(*token) + sizeof(*token->kad) + tktlen; - ret = key_payload_reserve(key, key->datalen + plen); - if (ret < 0) - return ret; - - plen -= sizeof(*token); - token = kmalloc(sizeof(*token), GFP_KERNEL); - if (!token) - return -ENOMEM; - - token->kad = kmalloc(plen, GFP_KERNEL); - if (!token->kad) { - kfree(token); - return -ENOMEM; - } - - token->security_index = RXRPC_SECURITY_RXKAD; - token->kad->ticket_len = tktlen; - token->kad->vice_id = ntohl(xdr[0]); - token->kad->kvno = ntohl(xdr[1]); - token->kad->start = ntohl(xdr[4]); - token->kad->expiry = ntohl(xdr[5]); - token->kad->primary_flag = ntohl(xdr[6]); - memcpy(&token->kad->session_key, &xdr[2], 8); - memcpy(&token->kad->ticket, &xdr[8], tktlen); - - _debug("SCIX: %u", token->security_index); - _debug("TLEN: %u", token->kad->ticket_len); - _debug("EXPY: %x", token->kad->expiry); - _debug("KVNO: %u", token->kad->kvno); - _debug("PRIM: %u", token->kad->primary_flag); - _debug("SKEY: %02x%02x%02x%02x%02x%02x%02x%02x", - token->kad->session_key[0], token->kad->session_key[1], - token->kad->session_key[2], token->kad->session_key[3], - token->kad->session_key[4], token->kad->session_key[5], - token->kad->session_key[6], token->kad->session_key[7]); - if (token->kad->ticket_len >= 8) - _debug("TCKT: %02x%02x%02x%02x%02x%02x%02x%02x", - token->kad->ticket[0], token->kad->ticket[1], - token->kad->ticket[2], token->kad->ticket[3], - token->kad->ticket[4], token->kad->ticket[5], - token->kad->ticket[6], token->kad->ticket[7]); - - /* count the number of tokens attached */ - key->type_data.x[0]++; - - /* attach the data */ - for (pptoken = (struct rxrpc_key_token **)&key->payload.data; - *pptoken; - pptoken = &(*pptoken)->next) - continue; - *pptoken = token; - if (token->kad->expiry < key->expiry) - key->expiry = token->kad->expiry; - - _leave(" = 0"); - return 0; -} - -static void rxrpc_free_krb5_principal(struct krb5_principal *princ) -{ - int loop; - - if (princ->name_parts) { - for (loop = princ->n_name_parts - 1; loop >= 0; loop--) - kfree(princ->name_parts[loop]); - kfree(princ->name_parts); - } - kfree(princ->realm); -} - -static void rxrpc_free_krb5_tagged(struct krb5_tagged_data *td) -{ - kfree(td->data); -} - -/* - * free up an RxK5 token - */ -static void rxrpc_rxk5_free(struct rxk5_key *rxk5) -{ - int loop; - - rxrpc_free_krb5_principal(&rxk5->client); - rxrpc_free_krb5_principal(&rxk5->server); - rxrpc_free_krb5_tagged(&rxk5->session); - - if (rxk5->addresses) { - for (loop = rxk5->n_addresses - 1; loop >= 0; loop--) - rxrpc_free_krb5_tagged(&rxk5->addresses[loop]); - kfree(rxk5->addresses); - } - if (rxk5->authdata) { - for (loop = rxk5->n_authdata - 1; loop >= 0; loop--) - rxrpc_free_krb5_tagged(&rxk5->authdata[loop]); - kfree(rxk5->authdata); - } - - kfree(rxk5->ticket); - kfree(rxk5->ticket2); - kfree(rxk5); -} - -/* - * extract a krb5 principal - */ -static int rxrpc_krb5_decode_principal(struct krb5_principal *princ, - const __be32 **_xdr, - unsigned *_toklen) -{ - const __be32 *xdr = *_xdr; - unsigned toklen = *_toklen, n_parts, loop, tmp; - - /* there must be at least one name, and at least #names+1 length - * words */ - if (toklen <= 12) - return -EINVAL; - - _enter(",{%x,%x,%x},%u", - ntohl(xdr[0]), ntohl(xdr[1]), ntohl(xdr[2]), toklen); - - n_parts = ntohl(*xdr++); - toklen -= 4; - if (n_parts <= 0 || n_parts > AFSTOKEN_K5_COMPONENTS_MAX) - return -EINVAL; - princ->n_name_parts = n_parts; - - if (toklen <= (n_parts + 1) * 4) - return -EINVAL; - - princ->name_parts = kcalloc(sizeof(char *), n_parts, GFP_KERNEL); - if (!princ->name_parts) - return -ENOMEM; - - for (loop = 0; loop < n_parts; loop++) { - if (toklen < 4) - return -EINVAL; - tmp = ntohl(*xdr++); - toklen -= 4; - if (tmp <= 0 || tmp > AFSTOKEN_STRING_MAX) - return -EINVAL; - if (tmp > toklen) - return -EINVAL; - princ->name_parts[loop] = kmalloc(tmp + 1, GFP_KERNEL); - if (!princ->name_parts[loop]) - return -ENOMEM; - memcpy(princ->name_parts[loop], xdr, tmp); - princ->name_parts[loop][tmp] = 0; - tmp = (tmp + 3) & ~3; - toklen -= tmp; - xdr += tmp >> 2; - } - - if (toklen < 4) - return -EINVAL; - tmp = ntohl(*xdr++); - toklen -= 4; - if (tmp <= 0 || tmp > AFSTOKEN_K5_REALM_MAX) - return -EINVAL; - if (tmp > toklen) - return -EINVAL; - princ->realm = kmalloc(tmp + 1, GFP_KERNEL); - if (!princ->realm) - return -ENOMEM; - memcpy(princ->realm, xdr, tmp); - princ->realm[tmp] = 0; - tmp = (tmp + 3) & ~3; - toklen -= tmp; - xdr += tmp >> 2; - - _debug("%s/...@%s", princ->name_parts[0], princ->realm); - - *_xdr = xdr; - *_toklen = toklen; - _leave(" = 0 [toklen=%u]", toklen); - return 0; -} - -/* - * extract a piece of krb5 tagged data - */ -static int rxrpc_krb5_decode_tagged_data(struct krb5_tagged_data *td, - size_t max_data_size, - const __be32 **_xdr, - unsigned *_toklen) -{ - const __be32 *xdr = *_xdr; - unsigned toklen = *_toklen, len; - - /* there must be at least one tag and one length word */ - if (toklen <= 8) - return -EINVAL; - - _enter(",%zu,{%x,%x},%u", - max_data_size, ntohl(xdr[0]), ntohl(xdr[1]), toklen); - - td->tag = ntohl(*xdr++); - len = ntohl(*xdr++); - toklen -= 8; - if (len > max_data_size) - return -EINVAL; - td->data_len = len; - - if (len > 0) { - td->data = kmalloc(len, GFP_KERNEL); - if (!td->data) - return -ENOMEM; - memcpy(td->data, xdr, len); - len = (len + 3) & ~3; - toklen -= len; - xdr += len >> 2; - } - - _debug("tag %x len %x", td->tag, td->data_len); - - *_xdr = xdr; - *_toklen = toklen; - _leave(" = 0 [toklen=%u]", toklen); - return 0; -} - -/* - * extract an array of tagged data - */ -static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td, - u8 *_n_elem, - u8 max_n_elem, - size_t max_elem_size, - const __be32 **_xdr, - unsigned *_toklen) -{ - struct krb5_tagged_data *td; - const __be32 *xdr = *_xdr; - unsigned toklen = *_toklen, n_elem, loop; - int ret; - - /* there must be at least one count */ - if (toklen < 4) - return -EINVAL; - - _enter(",,%u,%zu,{%x},%u", - max_n_elem, max_elem_size, ntohl(xdr[0]), toklen); - - n_elem = ntohl(*xdr++); - toklen -= 4; - if (n_elem < 0 || n_elem > max_n_elem) - return -EINVAL; - *_n_elem = n_elem; - if (n_elem > 0) { - if (toklen <= (n_elem + 1) * 4) - return -EINVAL; - - _debug("n_elem %d", n_elem); - - td = kcalloc(sizeof(struct krb5_tagged_data), n_elem, - GFP_KERNEL); - if (!td) - return -ENOMEM; - *_td = td; - - for (loop = 0; loop < n_elem; loop++) { - ret = rxrpc_krb5_decode_tagged_data(&td[loop], - max_elem_size, - &xdr, &toklen); - if (ret < 0) - return ret; - } - } - - *_xdr = xdr; - *_toklen = toklen; - _leave(" = 0 [toklen=%u]", toklen); - return 0; -} - -/* - * extract a krb5 ticket - */ -static int rxrpc_krb5_decode_ticket(u8 **_ticket, u16 *_tktlen, - const __be32 **_xdr, unsigned *_toklen) -{ - const __be32 *xdr = *_xdr; - unsigned toklen = *_toklen, len; - - /* there must be at least one length word */ - if (toklen <= 4) - return -EINVAL; - - _enter(",{%x},%u", ntohl(xdr[0]), toklen); - - len = ntohl(*xdr++); - toklen -= 4; - if (len > AFSTOKEN_K5_TIX_MAX) - return -EINVAL; - *_tktlen = len; - - _debug("ticket len %u", len); - - if (len > 0) { - *_ticket = kmalloc(len, GFP_KERNEL); - if (!*_ticket) - return -ENOMEM; - memcpy(*_ticket, xdr, len); - len = (len + 3) & ~3; - toklen -= len; - xdr += len >> 2; - } - - *_xdr = xdr; - *_toklen = toklen; - _leave(" = 0 [toklen=%u]", toklen); - return 0; -} - -/* - * parse an RxK5 type XDR format token - * - the caller guarantees we have at least 4 words - */ -static int rxrpc_instantiate_xdr_rxk5(struct key *key, const __be32 *xdr, - unsigned toklen) -{ - struct rxrpc_key_token *token, **pptoken; - struct rxk5_key *rxk5; - const __be32 *end_xdr = xdr + (toklen >> 2); - int ret; - - _enter(",{%x,%x,%x,%x},%u", - ntohl(xdr[0]), ntohl(xdr[1]), ntohl(xdr[2]), ntohl(xdr[3]), - toklen); - - /* reserve some payload space for this subkey - the length of the token - * is a reasonable approximation */ - ret = key_payload_reserve(key, key->datalen + toklen); - if (ret < 0) - return ret; - - token = kzalloc(sizeof(*token), GFP_KERNEL); - if (!token) - return -ENOMEM; - - rxk5 = kzalloc(sizeof(*rxk5), GFP_KERNEL); - if (!rxk5) { - kfree(token); - return -ENOMEM; - } - - token->security_index = RXRPC_SECURITY_RXK5; - token->k5 = rxk5; - - /* extract the principals */ - ret = rxrpc_krb5_decode_principal(&rxk5->client, &xdr, &toklen); - if (ret < 0) - goto error; - ret = rxrpc_krb5_decode_principal(&rxk5->server, &xdr, &toklen); - if (ret < 0) - goto error; - - /* extract the session key and the encoding type (the tag field -> - * ENCTYPE_xxx) */ - ret = rxrpc_krb5_decode_tagged_data(&rxk5->session, AFSTOKEN_DATA_MAX, - &xdr, &toklen); - if (ret < 0) - goto error; - - if (toklen < 4 * 8 + 2 * 4) - goto inval; - rxk5->authtime = be64_to_cpup((const __be64 *) xdr); - xdr += 2; - rxk5->starttime = be64_to_cpup((const __be64 *) xdr); - xdr += 2; - rxk5->endtime = be64_to_cpup((const __be64 *) xdr); - xdr += 2; - rxk5->renew_till = be64_to_cpup((const __be64 *) xdr); - xdr += 2; - rxk5->is_skey = ntohl(*xdr++); - rxk5->flags = ntohl(*xdr++); - toklen -= 4 * 8 + 2 * 4; - - _debug("times: a=%llx s=%llx e=%llx rt=%llx", - rxk5->authtime, rxk5->starttime, rxk5->endtime, - rxk5->renew_till); - _debug("is_skey=%x flags=%x", rxk5->is_skey, rxk5->flags); - - /* extract the permitted client addresses */ - ret = rxrpc_krb5_decode_tagged_array(&rxk5->addresses, - &rxk5->n_addresses, - AFSTOKEN_K5_ADDRESSES_MAX, - AFSTOKEN_DATA_MAX, - &xdr, &toklen); - if (ret < 0) - goto error; - - ASSERTCMP((end_xdr - xdr) << 2, ==, toklen); - - /* extract the tickets */ - ret = rxrpc_krb5_decode_ticket(&rxk5->ticket, &rxk5->ticket_len, - &xdr, &toklen); - if (ret < 0) - goto error; - ret = rxrpc_krb5_decode_ticket(&rxk5->ticket2, &rxk5->ticket2_len, - &xdr, &toklen); - if (ret < 0) - goto error; - - ASSERTCMP((end_xdr - xdr) << 2, ==, toklen); - - /* extract the typed auth data */ - ret = rxrpc_krb5_decode_tagged_array(&rxk5->authdata, - &rxk5->n_authdata, - AFSTOKEN_K5_AUTHDATA_MAX, - AFSTOKEN_BDATALN_MAX, - &xdr, &toklen); - if (ret < 0) - goto error; - - ASSERTCMP((end_xdr - xdr) << 2, ==, toklen); - - if (toklen != 0) - goto inval; - - /* attach the payload to the key */ - for (pptoken = (struct rxrpc_key_token **)&key->payload.data; - *pptoken; - pptoken = &(*pptoken)->next) - continue; - *pptoken = token; - if (token->kad->expiry < key->expiry) - key->expiry = token->kad->expiry; - - _leave(" = 0"); - return 0; - -inval: - ret = -EINVAL; -error: - rxrpc_rxk5_free(rxk5); - kfree(token); - _leave(" = %d", ret); - return ret; -} - -/* - * attempt to parse the data as the XDR format - * - the caller guarantees we have more than 7 words - */ -static int rxrpc_instantiate_xdr(struct key *key, const void *data, size_t datalen) -{ - const __be32 *xdr = data, *token; - const char *cp; - unsigned len, tmp, loop, ntoken, toklen, sec_ix; - int ret; - - _enter(",{%x,%x,%x,%x},%zu", - ntohl(xdr[0]), ntohl(xdr[1]), ntohl(xdr[2]), ntohl(xdr[3]), - datalen); - - if (datalen > AFSTOKEN_LENGTH_MAX) - goto not_xdr; - - /* XDR is an array of __be32's */ - if (datalen & 3) - goto not_xdr; - - /* the flags should be 0 (the setpag bit must be handled by - * userspace) */ - if (ntohl(*xdr++) != 0) - goto not_xdr; - datalen -= 4; - - /* check the cell name */ - len = ntohl(*xdr++); - if (len < 1 || len > AFSTOKEN_CELL_MAX) - goto not_xdr; - datalen -= 4; - tmp = (len + 3) & ~3; - if (tmp > datalen) - goto not_xdr; - - cp = (const char *) xdr; - for (loop = 0; loop < len; loop++) - if (!isprint(cp[loop])) - goto not_xdr; - if (len < tmp) - for (; loop < tmp; loop++) - if (cp[loop]) - goto not_xdr; - _debug("cellname: [%u/%u] '%*.*s'", - len, tmp, len, len, (const char *) xdr); - datalen -= tmp; - xdr += tmp >> 2; - - /* get the token count */ - if (datalen < 12) - goto not_xdr; - ntoken = ntohl(*xdr++); - datalen -= 4; - _debug("ntoken: %x", ntoken); - if (ntoken < 1 || ntoken > AFSTOKEN_MAX) - goto not_xdr; - - /* check each token wrapper */ - token = xdr; - loop = ntoken; - do { - if (datalen < 8) - goto not_xdr; - toklen = ntohl(*xdr++); - sec_ix = ntohl(*xdr); - datalen -= 4; - _debug("token: [%x/%zx] %x", toklen, datalen, sec_ix); - if (toklen < 20 || toklen > datalen) - goto not_xdr; - datalen -= (toklen + 3) & ~3; - xdr += (toklen + 3) >> 2; - - } while (--loop > 0); - - _debug("remainder: %zu", datalen); - if (datalen != 0) - goto not_xdr; - - /* okay: we're going to assume it's valid XDR format - * - we ignore the cellname, relying on the key to be correctly named - */ - do { - xdr = token; - toklen = ntohl(*xdr++); - token = xdr + ((toklen + 3) >> 2); - sec_ix = ntohl(*xdr++); - toklen -= 4; - - _debug("TOKEN type=%u [%p-%p]", sec_ix, xdr, token); - - switch (sec_ix) { - case RXRPC_SECURITY_RXKAD: - ret = rxrpc_instantiate_xdr_rxkad(key, xdr, toklen); - if (ret != 0) - goto error; - break; - - case RXRPC_SECURITY_RXK5: - ret = rxrpc_instantiate_xdr_rxk5(key, xdr, toklen); - if (ret != 0) - goto error; - break; - - default: - ret = -EPROTONOSUPPORT; - goto error; - } - - } while (--ntoken > 0); - - _leave(" = 0"); - return 0; - -not_xdr: - _leave(" = -EPROTO"); - return -EPROTO; -error: - _leave(" = %d", ret); - return ret; -} - /* * instantiate an rxrpc defined key * data should be of the form: @@ -662,8 +70,8 @@ static int rxrpc_instantiate_xdr(struct key *key, const void *data, size_t datal */ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) { - const struct rxrpc_key_data_v1 *v1; - struct rxrpc_key_token *token, **pp; + const struct rxkad_key *tsec; + struct rxrpc_key_payload *upayload; size_t plen; u32 kver; int ret; @@ -674,13 +82,6 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) if (!data && datalen == 0) return 0; - /* determine if the XDR payload format is being used */ - if (datalen > 7 * 4) { - ret = rxrpc_instantiate_xdr(key, data, datalen); - if (ret != -EPROTO) - return ret; - } - /* get the key interface version number */ ret = -EINVAL; if (datalen <= 4 || !data) @@ -697,67 +98,53 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) /* deal with a version 1 key */ ret = -EINVAL; - if (datalen < sizeof(*v1)) + if (datalen < sizeof(*tsec)) goto error; - v1 = data; - if (datalen != sizeof(*v1) + v1->ticket_length) + tsec = data; + if (datalen != sizeof(*tsec) + tsec->ticket_len) goto error; - _debug("SCIX: %u", v1->security_index); - _debug("TLEN: %u", v1->ticket_length); - _debug("EXPY: %x", v1->expiry); - _debug("KVNO: %u", v1->kvno); + _debug("SCIX: %u", tsec->security_index); + _debug("TLEN: %u", tsec->ticket_len); + _debug("EXPY: %x", tsec->expiry); + _debug("KVNO: %u", tsec->kvno); _debug("SKEY: %02x%02x%02x%02x%02x%02x%02x%02x", - v1->session_key[0], v1->session_key[1], - v1->session_key[2], v1->session_key[3], - v1->session_key[4], v1->session_key[5], - v1->session_key[6], v1->session_key[7]); - if (v1->ticket_length >= 8) + tsec->session_key[0], tsec->session_key[1], + tsec->session_key[2], tsec->session_key[3], + tsec->session_key[4], tsec->session_key[5], + tsec->session_key[6], tsec->session_key[7]); + if (tsec->ticket_len >= 8) _debug("TCKT: %02x%02x%02x%02x%02x%02x%02x%02x", - v1->ticket[0], v1->ticket[1], - v1->ticket[2], v1->ticket[3], - v1->ticket[4], v1->ticket[5], - v1->ticket[6], v1->ticket[7]); + tsec->ticket[0], tsec->ticket[1], + tsec->ticket[2], tsec->ticket[3], + tsec->ticket[4], tsec->ticket[5], + tsec->ticket[6], tsec->ticket[7]); ret = -EPROTONOSUPPORT; - if (v1->security_index != RXRPC_SECURITY_RXKAD) + if (tsec->security_index != 2) goto error; - plen = sizeof(*token->kad) + v1->ticket_length; - ret = key_payload_reserve(key, plen + sizeof(*token)); + key->type_data.x[0] = tsec->security_index; + + plen = sizeof(*upayload) + tsec->ticket_len; + ret = key_payload_reserve(key, plen); if (ret < 0) goto error; ret = -ENOMEM; - token = kmalloc(sizeof(*token), GFP_KERNEL); - if (!token) + upayload = kmalloc(plen, GFP_KERNEL); + if (!upayload) goto error; - token->kad = kmalloc(plen, GFP_KERNEL); - if (!token->kad) - goto error_free; - - token->security_index = RXRPC_SECURITY_RXKAD; - token->kad->ticket_len = v1->ticket_length; - token->kad->expiry = v1->expiry; - token->kad->kvno = v1->kvno; - memcpy(&token->kad->session_key, &v1->session_key, 8); - memcpy(&token->kad->ticket, v1->ticket, v1->ticket_length); /* attach the data */ - key->type_data.x[0]++; - - pp = (struct rxrpc_key_token **)&key->payload.data; - while (*pp) - pp = &(*pp)->next; - *pp = token; - if (token->kad->expiry < key->expiry) - key->expiry = token->kad->expiry; - token = NULL; + memcpy(&upayload->k, tsec, sizeof(*tsec)); + memcpy(&upayload->k.ticket, (void *)tsec + sizeof(*tsec), + tsec->ticket_len); + key->payload.data = upayload; + key->expiry = tsec->expiry; ret = 0; -error_free: - kfree(token); error: return ret; } @@ -797,26 +184,7 @@ static int rxrpc_instantiate_s(struct key *key, const void *data, */ static void rxrpc_destroy(struct key *key) { - struct rxrpc_key_token *token; - - while ((token = key->payload.data)) { - key->payload.data = token->next; - switch (token->security_index) { - case RXRPC_SECURITY_RXKAD: - kfree(token->kad); - break; - case RXRPC_SECURITY_RXK5: - if (token->k5) - rxrpc_rxk5_free(token->k5); - break; - default: - printk(KERN_ERR "Unknown token type %x on rxrpc key\n", - token->security_index); - BUG(); - } - - kfree(token); - } + kfree(key->payload.data); } /* @@ -925,7 +293,7 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *conn, struct { u32 kver; - struct rxrpc_key_data_v1 v1; + struct rxkad_key tsec; } data; _enter(""); @@ -940,12 +308,13 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *conn, _debug("key %d", key_serial(key)); data.kver = 1; - data.v1.security_index = RXRPC_SECURITY_RXKAD; - data.v1.ticket_length = 0; - data.v1.expiry = expiry; - data.v1.kvno = 0; + data.tsec.security_index = 2; + data.tsec.ticket_len = 0; + data.tsec.expiry = expiry; + data.tsec.kvno = 0; - memcpy(&data.v1.session_key, session_key, sizeof(data.v1.session_key)); + memcpy(&data.tsec.session_key, session_key, + sizeof(data.tsec.session_key)); ret = key_instantiate_and_link(key, &data, sizeof(data), NULL, NULL); if (ret < 0) @@ -991,210 +360,3 @@ struct key *rxrpc_get_null_key(const char *keyname) return key; } EXPORT_SYMBOL(rxrpc_get_null_key); - -/* - * read the contents of an rxrpc key - * - this returns the result in XDR form - */ -static long rxrpc_read(const struct key *key, - char __user *buffer, size_t buflen) -{ - const struct rxrpc_key_token *token; - const struct krb5_principal *princ; - size_t size; - __be32 __user *xdr, *oldxdr; - u32 cnlen, toksize, ntoks, tok, zero; - u16 toksizes[AFSTOKEN_MAX]; - int loop; - - _enter(""); - - /* we don't know what form we should return non-AFS keys in */ - if (memcmp(key->description, "afs@", 4) != 0) - return -EOPNOTSUPP; - cnlen = strlen(key->description + 4); - -#define RND(X) (((X) + 3) & ~3) - - /* AFS keys we return in XDR form, so we need to work out the size of - * the XDR */ - size = 2 * 4; /* flags, cellname len */ - size += RND(cnlen); /* cellname */ - size += 1 * 4; /* token count */ - - ntoks = 0; - for (token = key->payload.data; token; token = token->next) { - toksize = 4; /* sec index */ - - switch (token->security_index) { - case RXRPC_SECURITY_RXKAD: - toksize += 8 * 4; /* viceid, kvno, key*2, begin, - * end, primary, tktlen */ - toksize += RND(token->kad->ticket_len); - break; - - case RXRPC_SECURITY_RXK5: - princ = &token->k5->client; - toksize += 4 + princ->n_name_parts * 4; - for (loop = 0; loop < princ->n_name_parts; loop++) - toksize += RND(strlen(princ->name_parts[loop])); - toksize += 4 + RND(strlen(princ->realm)); - - princ = &token->k5->server; - toksize += 4 + princ->n_name_parts * 4; - for (loop = 0; loop < princ->n_name_parts; loop++) - toksize += RND(strlen(princ->name_parts[loop])); - toksize += 4 + RND(strlen(princ->realm)); - - toksize += 8 + RND(token->k5->session.data_len); - - toksize += 4 * 8 + 2 * 4; - - toksize += 4 + token->k5->n_addresses * 8; - for (loop = 0; loop < token->k5->n_addresses; loop++) - toksize += RND(token->k5->addresses[loop].data_len); - - toksize += 4 + RND(token->k5->ticket_len); - toksize += 4 + RND(token->k5->ticket2_len); - - toksize += 4 + token->k5->n_authdata * 8; - for (loop = 0; loop < token->k5->n_authdata; loop++) - toksize += RND(token->k5->authdata[loop].data_len); - break; - - default: /* we have a ticket we can't encode */ - BUG(); - continue; - } - - _debug("token[%u]: toksize=%u", ntoks, toksize); - ASSERTCMP(toksize, <=, AFSTOKEN_LENGTH_MAX); - - toksizes[ntoks++] = toksize; - size += toksize + 4; /* each token has a length word */ - } - -#undef RND - - if (!buffer || buflen < size) - return size; - - xdr = (__be32 __user *) buffer; - zero = 0; -#define ENCODE(x) \ - do { \ - __be32 y = htonl(x); \ - if (put_user(y, xdr++) < 0) \ - goto fault; \ - } while(0) -#define ENCODE_DATA(l, s) \ - do { \ - u32 _l = (l); \ - ENCODE(l); \ - if (copy_to_user(xdr, (s), _l) != 0) \ - goto fault; \ - if (_l & 3 && \ - copy_to_user((u8 *)xdr + _l, &zero, 4 - (_l & 3)) != 0) \ - goto fault; \ - xdr += (_l + 3) >> 2; \ - } while(0) -#define ENCODE64(x) \ - do { \ - __be64 y = cpu_to_be64(x); \ - if (copy_to_user(xdr, &y, 8) != 0) \ - goto fault; \ - xdr += 8 >> 2; \ - } while(0) -#define ENCODE_STR(s) \ - do { \ - const char *_s = (s); \ - ENCODE_DATA(strlen(_s), _s); \ - } while(0) - - ENCODE(0); /* flags */ - ENCODE_DATA(cnlen, key->description + 4); /* cellname */ - ENCODE(ntoks); - - tok = 0; - for (token = key->payload.data; token; token = token->next) { - toksize = toksizes[tok++]; - ENCODE(toksize); - oldxdr = xdr; - ENCODE(token->security_index); - - switch (token->security_index) { - case RXRPC_SECURITY_RXKAD: - ENCODE(token->kad->vice_id); - ENCODE(token->kad->kvno); - ENCODE_DATA(8, token->kad->session_key); - ENCODE(token->kad->start); - ENCODE(token->kad->expiry); - ENCODE(token->kad->primary_flag); - ENCODE_DATA(token->kad->ticket_len, token->kad->ticket); - break; - - case RXRPC_SECURITY_RXK5: - princ = &token->k5->client; - ENCODE(princ->n_name_parts); - for (loop = 0; loop < princ->n_name_parts; loop++) - ENCODE_STR(princ->name_parts[loop]); - ENCODE_STR(princ->realm); - - princ = &token->k5->server; - ENCODE(princ->n_name_parts); - for (loop = 0; loop < princ->n_name_parts; loop++) - ENCODE_STR(princ->name_parts[loop]); - ENCODE_STR(princ->realm); - - ENCODE(token->k5->session.tag); - ENCODE_DATA(token->k5->session.data_len, - token->k5->session.data); - - ENCODE64(token->k5->authtime); - ENCODE64(token->k5->starttime); - ENCODE64(token->k5->endtime); - ENCODE64(token->k5->renew_till); - ENCODE(token->k5->is_skey); - ENCODE(token->k5->flags); - - ENCODE(token->k5->n_addresses); - for (loop = 0; loop < token->k5->n_addresses; loop++) { - ENCODE(token->k5->addresses[loop].tag); - ENCODE_DATA(token->k5->addresses[loop].data_len, - token->k5->addresses[loop].data); - } - - ENCODE_DATA(token->k5->ticket_len, token->k5->ticket); - ENCODE_DATA(token->k5->ticket2_len, token->k5->ticket2); - - ENCODE(token->k5->n_authdata); - for (loop = 0; loop < token->k5->n_authdata; loop++) { - ENCODE(token->k5->authdata[loop].tag); - ENCODE_DATA(token->k5->authdata[loop].data_len, - token->k5->authdata[loop].data); - } - break; - - default: - BUG(); - break; - } - - ASSERTCMP((unsigned long)xdr - (unsigned long)oldxdr, ==, - toksize); - } - -#undef ENCODE_STR -#undef ENCODE_DATA -#undef ENCODE64 -#undef ENCODE - - ASSERTCMP(tok, ==, ntoks); - ASSERTCMP((char __user *) xdr - buffer, ==, size); - _leave(" = %zu", size); - return size; - -fault: - _leave(" = -EFAULT"); - return -EFAULT; -} diff --git a/trunk/net/rxrpc/ar-security.c b/trunk/net/rxrpc/ar-security.c index 49b3cc31ee1f..dc62920ee19a 100644 --- a/trunk/net/rxrpc/ar-security.c +++ b/trunk/net/rxrpc/ar-security.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "ar-internal.h" static LIST_HEAD(rxrpc_security_methods); @@ -123,7 +122,6 @@ EXPORT_SYMBOL_GPL(rxrpc_unregister_security); */ int rxrpc_init_client_conn_security(struct rxrpc_connection *conn) { - struct rxrpc_key_token *token; struct rxrpc_security *sec; struct key *key = conn->key; int ret; @@ -137,11 +135,7 @@ int rxrpc_init_client_conn_security(struct rxrpc_connection *conn) if (ret < 0) return ret; - if (!key->payload.data) - return -EKEYREJECTED; - token = key->payload.data; - - sec = rxrpc_security_lookup(token->security_index); + sec = rxrpc_security_lookup(key->type_data.x[0]); if (!sec) return -EKEYREJECTED; conn->security = sec; diff --git a/trunk/net/rxrpc/rxkad.c b/trunk/net/rxrpc/rxkad.c index 713ac593e2e9..ef8f91030a15 100644 --- a/trunk/net/rxrpc/rxkad.c +++ b/trunk/net/rxrpc/rxkad.c @@ -18,7 +18,6 @@ #include #include #include -#include #define rxrpc_debug rxkad_debug #include "ar-internal.h" @@ -43,7 +42,7 @@ struct rxkad_level2_hdr { __be32 checksum; /* decrypted data checksum */ }; -MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos 4)"); +MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos)"); MODULE_AUTHOR("Red Hat, Inc."); MODULE_LICENSE("GPL"); @@ -60,14 +59,14 @@ static DEFINE_MUTEX(rxkad_ci_mutex); */ static int rxkad_init_connection_security(struct rxrpc_connection *conn) { + struct rxrpc_key_payload *payload; struct crypto_blkcipher *ci; - struct rxrpc_key_token *token; int ret; _enter("{%d},{%x}", conn->debug_id, key_serial(conn->key)); - token = conn->key->payload.data; - conn->security_ix = token->security_index; + payload = conn->key->payload.data; + conn->security_ix = payload->k.security_index; ci = crypto_alloc_blkcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(ci)) { @@ -76,8 +75,8 @@ static int rxkad_init_connection_security(struct rxrpc_connection *conn) goto error; } - if (crypto_blkcipher_setkey(ci, token->kad->session_key, - sizeof(token->kad->session_key)) < 0) + if (crypto_blkcipher_setkey(ci, payload->k.session_key, + sizeof(payload->k.session_key)) < 0) BUG(); switch (conn->security_level) { @@ -111,7 +110,7 @@ static int rxkad_init_connection_security(struct rxrpc_connection *conn) */ static void rxkad_prime_packet_security(struct rxrpc_connection *conn) { - struct rxrpc_key_token *token; + struct rxrpc_key_payload *payload; struct blkcipher_desc desc; struct scatterlist sg[2]; struct rxrpc_crypt iv; @@ -124,8 +123,8 @@ static void rxkad_prime_packet_security(struct rxrpc_connection *conn) if (!conn->key) return; - token = conn->key->payload.data; - memcpy(&iv, token->kad->session_key, sizeof(iv)); + payload = conn->key->payload.data; + memcpy(&iv, payload->k.session_key, sizeof(iv)); desc.tfm = conn->cipher; desc.info = iv.x; @@ -198,7 +197,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, u32 data_size, void *sechdr) { - const struct rxrpc_key_token *token; + const struct rxrpc_key_payload *payload; struct rxkad_level2_hdr rxkhdr __attribute__((aligned(8))); /* must be all on one page */ struct rxrpc_skb_priv *sp; @@ -220,8 +219,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, rxkhdr.checksum = 0; /* encrypt from the session key */ - token = call->conn->key->payload.data; - memcpy(&iv, token->kad->session_key, sizeof(iv)); + payload = call->conn->key->payload.data; + memcpy(&iv, payload->k.session_key, sizeof(iv)); desc.tfm = call->conn->cipher; desc.info = iv.x; desc.flags = 0; @@ -401,7 +400,7 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call, struct sk_buff *skb, u32 *_abort_code) { - const struct rxrpc_key_token *token; + const struct rxrpc_key_payload *payload; struct rxkad_level2_hdr sechdr; struct rxrpc_skb_priv *sp; struct blkcipher_desc desc; @@ -432,8 +431,8 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call, skb_to_sgvec(skb, sg, 0, skb->len); /* decrypt from the session key */ - token = call->conn->key->payload.data; - memcpy(&iv, token->kad->session_key, sizeof(iv)); + payload = call->conn->key->payload.data; + memcpy(&iv, payload->k.session_key, sizeof(iv)); desc.tfm = call->conn->cipher; desc.info = iv.x; desc.flags = 0; @@ -507,7 +506,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call, if (!call->conn->cipher) return 0; - if (sp->hdr.securityIndex != RXRPC_SECURITY_RXKAD) { + if (sp->hdr.securityIndex != 2) { *_abort_code = RXKADINCONSISTENCY; _leave(" = -EPROTO [not rxkad]"); return -EPROTO; @@ -738,7 +737,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, struct sk_buff *skb, u32 *_abort_code) { - const struct rxrpc_key_token *token; + const struct rxrpc_key_payload *payload; struct rxkad_challenge challenge; struct rxkad_response resp __attribute__((aligned(8))); /* must be aligned for crypto */ @@ -779,7 +778,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, if (conn->security_level < min_level) goto protocol_error; - token = conn->key->payload.data; + payload = conn->key->payload.data; /* build the response packet */ memset(&resp, 0, sizeof(resp)); @@ -798,13 +797,13 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, (conn->channels[3] ? conn->channels[3]->call_id : 0); resp.encrypted.inc_nonce = htonl(nonce + 1); resp.encrypted.level = htonl(conn->security_level); - resp.kvno = htonl(token->kad->kvno); - resp.ticket_len = htonl(token->kad->ticket_len); + resp.kvno = htonl(payload->k.kvno); + resp.ticket_len = htonl(payload->k.ticket_len); /* calculate the response checksum and then do the encryption */ rxkad_calc_response_checksum(&resp); - rxkad_encrypt_response(conn, &resp, token->kad); - return rxkad_send_response(conn, &sp->hdr, &resp, token->kad); + rxkad_encrypt_response(conn, &resp, &payload->k); + return rxkad_send_response(conn, &sp->hdr, &resp, &payload->k); protocol_error: *_abort_code = abort_code; @@ -1123,7 +1122,7 @@ static void rxkad_clear(struct rxrpc_connection *conn) static struct rxrpc_security rxkad = { .owner = THIS_MODULE, .name = "rxkad", - .security_index = RXRPC_SECURITY_RXKAD, + .security_index = RXKAD_VERSION, .init_connection_security = rxkad_init_connection_security, .prime_packet_security = rxkad_prime_packet_security, .secure_packet = rxkad_secure_packet, diff --git a/trunk/net/sched/sch_api.c b/trunk/net/sched/sch_api.c index 903e4188b6ca..692d9a41cd23 100644 --- a/trunk/net/sched/sch_api.c +++ b/trunk/net/sched/sch_api.c @@ -693,18 +693,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, if (new && i > 0) atomic_inc(&new->refcnt); - if (!ingress) - qdisc_destroy(old); + qdisc_destroy(old); } - if (!ingress) { - notify_and_destroy(skb, n, classid, dev->qdisc, new); - if (new && !new->ops->attach) - atomic_inc(&new->refcnt); - dev->qdisc = new ? : &noop_qdisc; - } else { - notify_and_destroy(skb, n, classid, old, new); - } + notify_and_destroy(skb, n, classid, dev->qdisc, new); + if (new && !new->ops->attach) + atomic_inc(&new->refcnt); + dev->qdisc = new ? : &noop_qdisc; if (dev->flags & IFF_UP) dev_activate(dev); @@ -809,7 +804,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, stab = qdisc_get_stab(tca[TCA_STAB]); if (IS_ERR(stab)) { err = PTR_ERR(stab); - goto err_out4; + goto err_out3; } sch->stab = stab; } @@ -838,6 +833,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, return sch; } err_out3: + qdisc_put_stab(sch->stab); dev_put(dev); kfree((char *) sch - sch->padded); err_out2: @@ -851,7 +847,6 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, * Any broken qdiscs that would require a ops->reset() here? * The qdisc was never in action so it shouldn't be necessary. */ - qdisc_put_stab(sch->stab); if (ops->destroy) ops->destroy(sch); goto err_out3; @@ -1116,16 +1111,12 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) tcm->tcm_parent, tcm->tcm_parent, tca, &err); else { - struct netdev_queue *dev_queue; + unsigned int ntx = 0; if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) - dev_queue = p->ops->cl_ops->select_queue(p, tcm); - else if (p) - dev_queue = p->dev_queue; - else - dev_queue = netdev_get_tx_queue(dev, 0); + ntx = p->ops->cl_ops->select_queue(p, tcm); - q = qdisc_create(dev, dev_queue, p, + q = qdisc_create(dev, netdev_get_tx_queue(dev, ntx), p, tcm->tcm_parent, tcm->tcm_handle, tca, &err); } diff --git a/trunk/net/sched/sch_mq.c b/trunk/net/sched/sch_mq.c index 600c50143cc7..dd5ee022f1f7 100644 --- a/trunk/net/sched/sch_mq.c +++ b/trunk/net/sched/sch_mq.c @@ -125,18 +125,13 @@ static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl) return netdev_get_tx_queue(dev, ntx); } -static struct netdev_queue *mq_select_queue(struct Qdisc *sch, - struct tcmsg *tcm) +static unsigned int mq_select_queue(struct Qdisc *sch, struct tcmsg *tcm) { unsigned int ntx = TC_H_MIN(tcm->tcm_parent); - struct netdev_queue *dev_queue = mq_queue_get(sch, ntx); - if (!dev_queue) { - struct net_device *dev = qdisc_dev(sch); - - return netdev_get_tx_queue(dev, 0); - } - return dev_queue; + if (!mq_queue_get(sch, ntx)) + return 0; + return ntx - 1; } static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, diff --git a/trunk/net/sctp/ipv6.c b/trunk/net/sctp/ipv6.c index bb280e60e00a..6a4b19094143 100644 --- a/trunk/net/sctp/ipv6.c +++ b/trunk/net/sctp/ipv6.c @@ -949,7 +949,7 @@ static int sctp6_rcv(struct sk_buff *skb) return sctp_rcv(skb) ? -1 : 0; } -static const struct inet6_protocol sctpv6_protocol = { +static struct inet6_protocol sctpv6_protocol = { .handler = sctp6_rcv, .err_handler = sctp_v6_err, .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index c557f1fb1c66..60093be8385d 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -924,7 +924,7 @@ static struct inet_protosw sctp_stream_protosw = { }; /* Register with IP layer. */ -static const struct net_protocol sctp_protocol = { +static struct net_protocol sctp_protocol = { .handler = sctp_rcv, .err_handler = sctp_v4_err, .no_policy = 1, diff --git a/trunk/net/socket.c b/trunk/net/socket.c index 2a022c00d85c..6d4716559047 100644 --- a/trunk/net/socket.c +++ b/trunk/net/socket.c @@ -489,7 +489,6 @@ static struct socket *sock_alloc(void) sock = SOCKET_I(inode); - kmemcheck_annotate_bitfield(sock, type); inode->i_mode = S_IFSOCK | S_IRWXUGO; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); diff --git a/trunk/net/wireless/scan.c b/trunk/net/wireless/scan.c index e5f92ee758f4..4c210c2debc6 100644 --- a/trunk/net/wireless/scan.c +++ b/trunk/net/wireless/scan.c @@ -662,7 +662,7 @@ int cfg80211_wext_siwscan(struct net_device *dev, int k; int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; for (k = 0; k < wreq->num_channels; k++) { - int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]); + int wext_freq = wreq->channel_list[k].m / 100000; if (wext_freq == wiphy_freq) goto wext_freq_found; } @@ -675,11 +675,6 @@ int cfg80211_wext_siwscan(struct net_device *dev, wext_freq_not_found: ; } } - /* No channels found? */ - if (!i) { - err = -EINVAL; - goto out; - } /* Set real number of channels specified in creq->channels[] */ creq->n_channels = i; diff --git a/trunk/net/wireless/sme.c b/trunk/net/wireless/sme.c index 7fae7eee65de..68307883ec87 100644 --- a/trunk/net/wireless/sme.c +++ b/trunk/net/wireless/sme.c @@ -188,7 +188,7 @@ void cfg80211_conn_work(struct work_struct *work) rtnl_unlock(); } -static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) +static bool cfg80211_get_conn_bss(struct wireless_dev *wdev) { struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_bss *bss; @@ -205,7 +205,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY, capa); if (!bss) - return NULL; + return false; memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN); wdev->conn->params.bssid = wdev->conn->bssid; @@ -213,14 +213,14 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; schedule_work(&rdev->conn_work); - return bss; + cfg80211_put_bss(bss); + return true; } static void __cfg80211_sme_scan_done(struct net_device *dev) { struct wireless_dev *wdev = dev->ieee80211_ptr; struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); - struct cfg80211_bss *bss; ASSERT_WDEV_LOCK(wdev); @@ -234,10 +234,7 @@ static void __cfg80211_sme_scan_done(struct net_device *dev) wdev->conn->state != CFG80211_CONN_SCAN_AGAIN) return; - bss = cfg80211_get_conn_bss(wdev); - if (bss) { - cfg80211_put_bss(bss); - } else { + if (!cfg80211_get_conn_bss(wdev)) { /* not found */ if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN) schedule_work(&rdev->conn_work); @@ -673,7 +670,6 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev, { struct wireless_dev *wdev = dev->ieee80211_ptr; struct ieee80211_channel *chan; - struct cfg80211_bss *bss = NULL; int err; ASSERT_WDEV_LOCK(wdev); @@ -764,7 +760,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev, /* don't care about result -- but fill bssid & channel */ if (!wdev->conn->params.bssid || !wdev->conn->params.channel) - bss = cfg80211_get_conn_bss(wdev); + cfg80211_get_conn_bss(wdev); wdev->sme_state = CFG80211_SME_CONNECTING; wdev->connect_keys = connkeys; @@ -774,11 +770,10 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev, wdev->conn->prev_bssid_valid = true; } - /* we're good if we have a matching bss struct */ - if (bss) { + /* we're good if we have both BSSID and channel */ + if (wdev->conn->params.bssid && wdev->conn->params.channel) { wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; err = cfg80211_conn_do_work(wdev); - cfg80211_put_bss(bss); } else { /* otherwise we'll need to scan for the AP first */ err = cfg80211_conn_scan(wdev);