Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
  [NETFILTER]: fix ebtable targets return
  [IP_TUNNEL]: Don't limit the number of tunnels with generic name explicitly.
  [NET]: Restore sanity wrt. print_mac().
  [NEIGH]: Fix race between neighbor lookup and table's hash_rnd update.
  [RTNL]: Validate hardware and broadcast address attribute for RTM_NEWLINK
  tg3: ethtool phys_id default
  [BNX2]: Update version to 1.7.4.
  [BNX2]: Disable parallel detect on an HP blade.
  [BNX2]: More 5706S link down workaround.
  ssb: Fix support for PCI devices behind a SSB->PCI bridge
  zd1211rw: fix sparse warnings
  rtl818x: fix sparse warnings
  ssb: Fix pcicore cardbus mode
  ssb: Make the GPIO API reentrancy safe
  ssb: Fix the GPIO API
  ssb: Fix watchdog access for devices without a chipcommon
  ssb: Fix serial console on new bcm47xx devices
  ath5k: Fix build warnings on some 64-bit platforms.
  WDEV, ath5k, don't return int from bool function
  WDEV: ath5k, fix lock imbalance
  ...
  • Loading branch information
Linus Torvalds committed Feb 24, 2008
2 parents 85b80eb + 1b04ab4 commit bdc0894
Show file tree
Hide file tree
Showing 51 changed files with 521 additions and 180 deletions.
50 changes: 32 additions & 18 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.7.3"
#define DRV_MODULE_RELDATE "January 29, 2008"
#define DRV_MODULE_VERSION "1.7.4"
#define DRV_MODULE_RELDATE "February 18, 2008"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -1273,14 +1273,20 @@ bnx2_set_link(struct bnx2 *bp)

if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
(CHIP_NUM(bp) == CHIP_NUM_5706)) {
u32 val;
u32 val, an_dbg;

if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) {
bnx2_5706s_force_link_dn(bp, 0);
bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN;
}
val = REG_RD(bp, BNX2_EMAC_STATUS);
if (val & BNX2_EMAC_STATUS_LINK)

bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);

if ((val & BNX2_EMAC_STATUS_LINK) &&
!(an_dbg & MISC_SHDW_AN_DBG_NOSYNC))
bmsr |= BMSR_LSTATUS;
else
bmsr &= ~BMSR_LSTATUS;
Expand Down Expand Up @@ -5356,11 +5362,15 @@ bnx2_test_intr(struct bnx2 *bp)
return -ENODEV;
}

/* Determining link for parallel detection. */
static int
bnx2_5706_serdes_has_link(struct bnx2 *bp)
{
u32 mode_ctl, an_dbg, exp;

if (bp->phy_flags & BNX2_PHY_FLAG_NO_PARALLEL)
return 0;

bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_MODE_CTL);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &mode_ctl);

Expand Down Expand Up @@ -5390,13 +5400,6 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
int check_link = 1;

spin_lock(&bp->phy_lock);
if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) {
bnx2_5706s_force_link_dn(bp, 0);
bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN;
spin_unlock(&bp->phy_lock);
return;
}

if (bp->serdes_an_pending) {
bp->serdes_an_pending--;
check_link = 0;
Expand All @@ -5420,7 +5423,6 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
(bp->phy_flags & BNX2_PHY_FLAG_PARALLEL_DETECT)) {
u32 phy2;

check_link = 0;
bnx2_write_phy(bp, 0x17, 0x0f01);
bnx2_read_phy(bp, 0x15, &phy2);
if (phy2 & 0x20) {
Expand All @@ -5435,17 +5437,21 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
} else
bp->current_interval = bp->timer_interval;

if (bp->link_up && (bp->autoneg & AUTONEG_SPEED) && check_link) {
if (check_link) {
u32 val;

bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val);

if (val & MISC_SHDW_AN_DBG_NOSYNC) {
bnx2_5706s_force_link_dn(bp, 1);
bp->phy_flags |= BNX2_PHY_FLAG_FORCED_DOWN;
}
if (bp->link_up && (val & MISC_SHDW_AN_DBG_NOSYNC)) {
if (!(bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN)) {
bnx2_5706s_force_link_dn(bp, 1);
bp->phy_flags |= BNX2_PHY_FLAG_FORCED_DOWN;
} else
bnx2_set_link(bp);
} else if (!bp->link_up && !(val & MISC_SHDW_AN_DBG_NOSYNC))
bnx2_set_link(bp);
}
spin_unlock(&bp->phy_lock);
}
Expand Down Expand Up @@ -7326,7 +7332,15 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->flags |= BNX2_FLAG_NO_WOL;
bp->wol = 0;
}
if (CHIP_NUM(bp) != CHIP_NUM_5706) {
if (CHIP_NUM(bp) == CHIP_NUM_5706) {
/* Don't do parallel detect on this board because of
* some board problems. The link will not go down
* if we do parallel detect.
*/
if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
pdev->subsystem_device == 0x310c)
bp->phy_flags |= BNX2_PHY_FLAG_NO_PARALLEL;
} else {
bp->phy_addr = 2;
if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)
bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -6673,6 +6673,7 @@ struct bnx2 {
#define BNX2_PHY_FLAG_DIS_EARLY_DAC 0x00000400
#define BNX2_PHY_FLAG_REMOTE_PHY_CAP 0x00000800
#define BNX2_PHY_FLAG_FORCED_DOWN 0x00001000
#define BNX2_PHY_FLAG_NO_PARALLEL 0x00002000

u32 mii_bmcr;
u32 mii_bmsr;
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int index, int on)
if (index >= niu_num_alt_addr(np))
return -EINVAL;

if (np->flags & NIU_FLAGS_XMAC)
if (np->flags & NIU_FLAGS_XMAC) {
reg = XMAC_ADDR_CMPEN;
else
mask = 1 << index;
} else {
reg = BMAC_ADDR_CMPEN;

mask = 1 << index;
mask = 1 << (index + 1);
}

val = nr64_mac(reg);
if (on)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/niu.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
#define BMAC_ADDR2 0x00110UL
#define BMAC_ADDR2_ADDR2 0x000000000000ffffULL

#define BMAC_NUM_ALT_ADDR 7
#define BMAC_NUM_ALT_ADDR 6

#define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL)
#define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -8781,7 +8781,7 @@ static int tg3_phys_id(struct net_device *dev, u32 data)
return -EAGAIN;

if (data == 0)
data = 2;
data = UINT_MAX / 2;

for (i = 0; i < (data * 2); i++) {
if ((i % 2) == 0)
Expand Down
53 changes: 40 additions & 13 deletions drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,6 @@ static int veth_open(struct net_device *dev)
return 0;
}

static int veth_close(struct net_device *dev)
{
struct veth_priv *priv;

if (netif_carrier_ok(dev)) {
priv = netdev_priv(dev);
netif_carrier_off(dev);
netif_carrier_off(priv->peer);
}
return 0;
}

static int veth_dev_init(struct net_device *dev)
{
struct veth_net_stats *stats;
Expand Down Expand Up @@ -286,13 +274,50 @@ static void veth_setup(struct net_device *dev)
dev->hard_start_xmit = veth_xmit;
dev->get_stats = veth_get_stats;
dev->open = veth_open;
dev->stop = veth_close;
dev->ethtool_ops = &veth_ethtool_ops;
dev->features |= NETIF_F_LLTX;
dev->init = veth_dev_init;
dev->destructor = veth_dev_free;
}

static void veth_change_state(struct net_device *dev)
{
struct net_device *peer;
struct veth_priv *priv;

priv = netdev_priv(dev);
peer = priv->peer;

if (netif_carrier_ok(peer)) {
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
} else {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
}
}

static int veth_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
struct net_device *dev = ptr;

if (dev->open != veth_open)
goto out;

switch (event) {
case NETDEV_CHANGE:
veth_change_state(dev);
break;
}
out:
return NOTIFY_DONE;
}

static struct notifier_block veth_notifier_block __read_mostly = {
.notifier_call = veth_device_event,
};

/*
* netlink interface
*/
Expand Down Expand Up @@ -454,12 +479,14 @@ static struct rtnl_link_ops veth_link_ops = {

static __init int veth_init(void)
{
register_netdevice_notifier(&veth_notifier_block);
return rtnl_link_register(&veth_link_ops);
}

static __exit void veth_exit(void)
{
rtnl_link_unregister(&veth_link_ops);
unregister_netdevice_notifier(&veth_notifier_block);
}

module_init(veth_init);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ struct ath5k_hw {
unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int,
unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int);
bool (*ah_setup_xtx_desc)(struct ath5k_hw *, struct ath5k_desc *,
int (*ah_setup_xtx_desc)(struct ath5k_hw *, struct ath5k_desc *,
unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int);
int (*ah_proc_tx_desc)(struct ath5k_hw *, struct ath5k_desc *);
Expand Down
20 changes: 13 additions & 7 deletions drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,10 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
* return false w/o doing anything. MAC's that do
* support it will return true w/o doing anything.
*/
if (ah->ah_setup_xtx_desc(ah, NULL, 0, 0, 0, 0, 0, 0))
ret = ah->ah_setup_xtx_desc(ah, NULL, 0, 0, 0, 0, 0, 0);
if (ret < 0)
goto err;
if (ret > 0)
__set_bit(ATH_STAT_MRRETRY, sc->status);

/*
Expand Down Expand Up @@ -1715,6 +1718,7 @@ ath5k_tasklet_rx(unsigned long data)
break;
else if (unlikely(ret)) {
ATH5K_ERR(sc, "error in processing rx descriptor\n");
spin_unlock(&sc->rxbuflock);
return;
}

Expand Down Expand Up @@ -2126,8 +2130,9 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf)
"updated timers based on beacon TSF\n");

ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON,
"bc_tsf %llx hw_tsf %llx bc_tu %u hw_tu %u nexttbtt %u\n",
bc_tsf, hw_tsf, bc_tu, hw_tu, nexttbtt);
"bc_tsf %llx hw_tsf %llx bc_tu %u hw_tu %u nexttbtt %u\n",
(unsigned long long) bc_tsf,
(unsigned long long) hw_tsf, bc_tu, hw_tu, nexttbtt);
ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "intval %u %s %s\n",
intval & AR5K_BEACON_PERIOD,
intval & AR5K_BEACON_ENA ? "AR5K_BEACON_ENA" : "",
Expand Down Expand Up @@ -2385,10 +2390,11 @@ ath5k_intr(int irq, void *dev_id)
u64 tsf = ath5k_hw_get_tsf64(ah);
sc->nexttbtt += sc->bintval;
ATH5K_DBG(sc, ATH5K_DEBUG_BEACON,
"SWBA nexttbtt: %x hw_tu: %x "
"TSF: %llx\n",
sc->nexttbtt,
TSF_TO_TU(tsf), tsf);
"SWBA nexttbtt: %x hw_tu: %x "
"TSF: %llx\n",
sc->nexttbtt,
TSF_TO_TU(tsf),
(unsigned long long) tsf);
} else {
ath5k_beacon_send(sc);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath5k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *, struct ath5k_desc *,
unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int,
unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int);
static bool ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *,
static int ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *,
unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int);
static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *, struct ath5k_desc *);
Expand Down Expand Up @@ -3743,7 +3743,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
/*
* Initialize a 4-word multirate tx descriptor on 5212
*/
static bool
static int
ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
unsigned int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2,
unsigned int tx_rate3, u_int tx_tries3)
Expand Down Expand Up @@ -3783,10 +3783,10 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,

#undef _XTX_TRIES

return true;
return 1;
}

return false;
return 0;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/p54usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
{USB_DEVICE(0x083a, 0x4501)}, /* Accton 802.11g WN4501 USB */
{USB_DEVICE(0x083a, 0x4502)}, /* Siemens Gigaset USB Adapter */
{USB_DEVICE(0x083a, 0x5501)}, /* Phillips CPWUA054 */
{USB_DEVICE(0x0846, 0x4200)}, /* Netgear WG121 */
{USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */
{USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
Expand Down Expand Up @@ -62,6 +63,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */
{USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */
{USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
{USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */
{USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
{USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
{USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/rtl8180_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio)
while (skb_queue_len(&ring->queue)) {
struct rtl8180_tx_desc *entry = &ring->desc[ring->idx];
struct sk_buff *skb;
struct ieee80211_tx_status status = { {0} };
struct ieee80211_tx_status status;
struct ieee80211_tx_control *control;
u32 flags = le32_to_cpu(entry->flags);

if (flags & RTL8180_TX_DESC_FLAG_OWN)
return;

memset(&status, 0, sizeof(status));

ring->idx = (ring->idx + 1) % ring->entries;
skb = __skb_dequeue(&ring->queue);
pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf),
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)

static void rtl8187_tx_cb(struct urb *urb)
{
struct ieee80211_tx_status status = { {0} };
struct ieee80211_tx_status status;
struct sk_buff *skb = (struct sk_buff *)urb->context;
struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb;

memset(&status, 0, sizeof(status));

usb_free_urb(info->urb);
if (info->control)
memcpy(&status.control, info->control, sizeof(status.control));
Expand Down
Loading

0 comments on commit bdc0894

Please sign in to comment.