Commit f327220b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

parents 31b3c31b ea182d4a
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#define DRV_MODULE_NAME "b44" #define DRV_MODULE_NAME "b44"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "0.96" #define DRV_MODULE_VERSION "0.97"
#define DRV_MODULE_RELDATE "Nov 8, 2005" #define DRV_MODULE_RELDATE "Nov 30, 2005"
#define B44_DEF_MSG_ENABLE \ #define B44_DEF_MSG_ENABLE \
(NETIF_MSG_DRV | \ (NETIF_MSG_DRV | \
...@@ -1417,6 +1417,7 @@ static int b44_open(struct net_device *dev) ...@@ -1417,6 +1417,7 @@ static int b44_open(struct net_device *dev)
add_timer(&bp->timer); add_timer(&bp->timer);
b44_enable_ints(bp); b44_enable_ints(bp);
netif_start_queue(dev);
out: out:
return err; return err;
} }
...@@ -1837,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1837,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
struct mii_ioctl_data *data = if_mii(ifr); struct mii_ioctl_data *data = if_mii(ifr);
struct b44 *bp = netdev_priv(dev); struct b44 *bp = netdev_priv(dev);
int err; int err = -EINVAL;
if (!netif_running(dev))
goto out;
spin_lock_irq(&bp->lock); spin_lock_irq(&bp->lock);
err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL); err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
spin_unlock_irq(&bp->lock); spin_unlock_irq(&bp->lock);
out:
return err; return err;
} }
...@@ -2113,6 +2117,7 @@ static int b44_resume(struct pci_dev *pdev) ...@@ -2113,6 +2117,7 @@ static int b44_resume(struct pci_dev *pdev)
add_timer(&bp->timer); add_timer(&bp->timer);
b44_enable_ints(bp); b44_enable_ints(bp);
netif_wake_queue(dev);
return 0; return 0;
} }
......
...@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) ...@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) ) E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
return 0; return 0;
} }
if(htons(ETH_P_IP) == skb->protocol) { if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
const struct iphdr *ip = skb->nh.iph;
if(IPPROTO_UDP == ip->protocol) {
struct udphdr *udp = (struct udphdr *)(skb->h.uh);
if(ntohs(udp->dest) == 67) {
offset = (uint8_t *)udp + 8 - skb->data;
length = skb->len - offset;
return e1000_mng_write_dhcp_info(hw,
(uint8_t *)udp + 8, length);
}
}
} else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
struct ethhdr *eth = (struct ethhdr *) skb->data; struct ethhdr *eth = (struct ethhdr *) skb->data;
if((htons(ETH_P_IP) == eth->h_proto)) { if((htons(ETH_P_IP) == eth->h_proto)) {
const struct iphdr *ip = const struct iphdr *ip =
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
*/ */
#define DRV_NAME "emac" #define DRV_NAME "emac"
#define DRV_VERSION "3.53" #define DRV_VERSION "3.54"
#define DRV_DESC "PPC 4xx OCP EMAC driver" #define DRV_DESC "PPC 4xx OCP EMAC driver"
MODULE_DESCRIPTION(DRV_DESC); MODULE_DESCRIPTION(DRV_DESC);
...@@ -158,6 +158,14 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev, ...@@ -158,6 +158,14 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev,
#define PHY_POLL_LINK_ON HZ #define PHY_POLL_LINK_ON HZ
#define PHY_POLL_LINK_OFF (HZ / 5) #define PHY_POLL_LINK_OFF (HZ / 5)
/* Graceful stop timeouts in us.
* We should allow up to 1 frame time (full-duplex, ignoring collisions)
*/
#define STOP_TIMEOUT_10 1230
#define STOP_TIMEOUT_100 124
#define STOP_TIMEOUT_1000 13
#define STOP_TIMEOUT_1000_JUMBO 73
/* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */ /* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = { static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
"rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum", "rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
...@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_enet_private *dev) ...@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_enet_private *dev)
r = in_be32(&p->mr0); r = in_be32(&p->mr0);
if (r & EMAC_MR0_TXE) { if (r & EMAC_MR0_TXE) {
int n = 300; int n = dev->stop_timeout;
out_be32(&p->mr0, r & ~EMAC_MR0_TXE); out_be32(&p->mr0, r & ~EMAC_MR0_TXE);
while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) {
udelay(1);
--n; --n;
}
if (unlikely(!n)) if (unlikely(!n))
emac_report_timeout_error(dev, "TX disable timeout"); emac_report_timeout_error(dev, "TX disable timeout");
} }
...@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_enet_private *dev) ...@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
if (!(r & EMAC_MR0_RXE)) { if (!(r & EMAC_MR0_RXE)) {
if (unlikely(!(r & EMAC_MR0_RXI))) { if (unlikely(!(r & EMAC_MR0_RXI))) {
/* Wait if previous async disable is still in progress */ /* Wait if previous async disable is still in progress */
int n = 100; int n = dev->stop_timeout;
while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
udelay(1);
--n; --n;
}
if (unlikely(!n)) if (unlikely(!n))
emac_report_timeout_error(dev, emac_report_timeout_error(dev,
"RX disable timeout"); "RX disable timeout");
...@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_enet_private *dev) ...@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_enet_private *dev)
r = in_be32(&p->mr0); r = in_be32(&p->mr0);
if (r & EMAC_MR0_RXE) { if (r & EMAC_MR0_RXE) {
int n = 300; int n = dev->stop_timeout;
out_be32(&p->mr0, r & ~EMAC_MR0_RXE); out_be32(&p->mr0, r & ~EMAC_MR0_RXE);
while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
udelay(1);
--n; --n;
}
if (unlikely(!n)) if (unlikely(!n))
emac_report_timeout_error(dev, "RX disable timeout"); emac_report_timeout_error(dev, "RX disable timeout");
} }
...@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_enet_private *dev) ...@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_enet_private *dev)
r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST; r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
if (dev->phy.duplex == DUPLEX_FULL) if (dev->phy.duplex == DUPLEX_FULL)
r |= EMAC_MR1_FDE; r |= EMAC_MR1_FDE;
dev->stop_timeout = STOP_TIMEOUT_10;
switch (dev->phy.speed) { switch (dev->phy.speed) {
case SPEED_1000: case SPEED_1000:
if (emac_phy_gpcs(dev->phy.mode)) { if (emac_phy_gpcs(dev->phy.mode)) {
...@@ -409,12 +424,16 @@ static int emac_configure(struct ocp_enet_private *dev) ...@@ -409,12 +424,16 @@ static int emac_configure(struct ocp_enet_private *dev)
r |= EMAC_MR1_MF_1000; r |= EMAC_MR1_MF_1000;
r |= EMAC_MR1_RFS_16K; r |= EMAC_MR1_RFS_16K;
gige = 1; gige = 1;
if (dev->ndev->mtu > ETH_DATA_LEN) if (dev->ndev->mtu > ETH_DATA_LEN) {
r |= EMAC_MR1_JPSM; r |= EMAC_MR1_JPSM;
dev->stop_timeout = STOP_TIMEOUT_1000_JUMBO;
} else
dev->stop_timeout = STOP_TIMEOUT_1000;
break; break;
case SPEED_100: case SPEED_100:
r |= EMAC_MR1_MF_100; r |= EMAC_MR1_MF_100;
dev->stop_timeout = STOP_TIMEOUT_100;
/* Fall through */ /* Fall through */
default: default:
r |= EMAC_MR1_RFS_4K; r |= EMAC_MR1_RFS_4K;
...@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_device *ocpdev) ...@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
dev->phy.duplex = DUPLEX_FULL; dev->phy.duplex = DUPLEX_FULL;
dev->phy.autoneg = AUTONEG_DISABLE; dev->phy.autoneg = AUTONEG_DISABLE;
dev->phy.pause = dev->phy.asym_pause = 0; dev->phy.pause = dev->phy.asym_pause = 0;
dev->stop_timeout = STOP_TIMEOUT_100;
init_timer(&dev->link_timer); init_timer(&dev->link_timer);
dev->link_timer.function = emac_link_timer; dev->link_timer.function = emac_link_timer;
dev->link_timer.data = (unsigned long)dev; dev->link_timer.data = (unsigned long)dev;
......
...@@ -189,6 +189,8 @@ struct ocp_enet_private { ...@@ -189,6 +189,8 @@ struct ocp_enet_private {
struct timer_list link_timer; struct timer_list link_timer;
int reset_failed; int reset_failed;
int stop_timeout; /* in us */
struct ibm_emac_error_stats estats; struct ibm_emac_error_stats estats;
struct net_device_stats nstats; struct net_device_stats nstats;
......
...@@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void) ...@@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void)
} }
jazz_sonic_device = platform_device_alloc(jazz_sonic_string, 0); jazz_sonic_device = platform_device_alloc(jazz_sonic_string, 0);
if (!jazz_sonnic_device) if (!jazz_sonic_device)
goto out_unregister; goto out_unregister;
if (platform_device_add(jazz_sonic_device)) { if (platform_device_add(jazz_sonic_device)) {
...@@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void) ...@@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void)
return 0; return 0;
out_unregister: out_unregister:
driver_unregister(&jazz_sonic_driver); platform_driver_unregister(&jazz_sonic_driver);
return -ENOMEM; return -ENOMEM;
} }
......
// /*
// <COPYRIGHT CLASS="1B" YEAR="2005"> * This file is subject to the terms and conditions of the GNU General Public
// Unpublished work (c) MIPS Technologies, Inc. All rights reserved. * License. See the file "COPYING" in the main directory of this archive
// Unpublished rights reserved under the copyright laws of the U.S.A. and * for more details.
// other countries. */
//
// PROPRIETARY / SECRET CONFIDENTIAL INFORMATION OF MIPS TECHNOLOGIES, INC.
// FOR INTERNAL USE ONLY.
//
// Under no circumstances (contract or otherwise) may this information be
// disclosed to, or copied, modified or used by anyone other than employees
// or contractors of MIPS Technologies having a need to know.
// </COPYRIGHT>
//
//++
// File: MIPS_Net.h
//
// Description:
// The definition of the emulated MIPSNET device's interface.
//
// Notes: This include file needs to work from a Linux device drivers.
//
//--
//
#ifndef __MIPSNET_H #ifndef __MIPSNET_H
#define __MIPSNET_H #define __MIPSNET_H
......
...@@ -131,10 +131,9 @@ typedef struct local_info_t { ...@@ -131,10 +131,9 @@ typedef struct local_info_t {
u_short tx_queue_len; u_short tx_queue_len;
cardtype_t cardtype; cardtype_t cardtype;
u_short sent; u_short sent;
u_char mc_filter[8];
} local_info_t; } local_info_t;
#define MC_FILTERBREAK 8 #define MC_FILTERBREAK 64
/*====================================================================*/ /*====================================================================*/
/* /*
...@@ -1005,15 +1004,8 @@ static void fjn_reset(struct net_device *dev) ...@@ -1005,15 +1004,8 @@ static void fjn_reset(struct net_device *dev)
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
outb(dev->dev_addr[i], ioaddr + NODE_ID + i); outb(dev->dev_addr[i], ioaddr + NODE_ID + i);
/* Switch to bank 1 */ /* (re)initialize the multicast table */
if (lp->cardtype == MBH10302) set_rx_mode(dev);
outb(BANK_1, ioaddr + CONFIG_1);
else
outb(BANK_1U, ioaddr + CONFIG_1);
/* set the multicast table to accept none. */
for (i = 0; i < 8; i++)
outb(0x00, ioaddr + MAR_ADR + i);
/* Switch to bank 2 (runtime mode) */ /* Switch to bank 2 (runtime mode) */
if (lp->cardtype == MBH10302) if (lp->cardtype == MBH10302)
...@@ -1264,11 +1256,11 @@ static struct net_device_stats *fjn_get_stats(struct net_device *dev) ...@@ -1264,11 +1256,11 @@ static struct net_device_stats *fjn_get_stats(struct net_device *dev)
static void set_rx_mode(struct net_device *dev) static void set_rx_mode(struct net_device *dev)
{ {
kio_addr_t ioaddr = dev->base_addr; kio_addr_t ioaddr = dev->base_addr;
struct local_info_t *lp = netdev_priv(dev);
u_char mc_filter[8]; /* Multicast hash filter */ u_char mc_filter[8]; /* Multicast hash filter */
u_long flags; u_long flags;
int i; int i;
int saved_bank;
int saved_config_0 = inb(ioaddr + CONFIG_0); int saved_config_0 = inb(ioaddr + CONFIG_0);
local_irq_save(flags); local_irq_save(flags);
...@@ -1306,15 +1298,13 @@ static void set_rx_mode(struct net_device *dev) ...@@ -1306,15 +1298,13 @@ static void set_rx_mode(struct net_device *dev)
outb(2, ioaddr + RX_MODE); /* Use normal mode. */ outb(2, ioaddr + RX_MODE); /* Use normal mode. */
} }
if (memcmp(mc_filter, lp->mc_filter, sizeof(mc_filter))) { /* Switch to bank 1 and set the multicast table. */
int saved_bank = inb(ioaddr + CONFIG_1); saved_bank = inb(ioaddr + CONFIG_1);
/* Switch to bank 1 and set the multicast table. */ outb(0xe4, ioaddr + CONFIG_1);
outb(0xe4, ioaddr + CONFIG_1);
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
outb(mc_filter[i], ioaddr + MAR_ADR + i); outb(mc_filter[i], ioaddr + MAR_ADR + i);
memcpy(lp->mc_filter, mc_filter, sizeof(mc_filter)); outb(saved_bank, ioaddr + CONFIG_1);
outb(saved_bank, ioaddr + CONFIG_1);
}
outb(saved_config_0, ioaddr + CONFIG_0); outb(saved_config_0, ioaddr + CONFIG_0);
......
...@@ -27,8 +27,7 @@ sk98lin-objs := \ ...@@ -27,8 +27,7 @@ sk98lin-objs := \
sktimer.o \ sktimer.o \
skvpd.o \ skvpd.o \
skxmac2.o \ skxmac2.o \
skproc.o \ skproc.o
skcsum.o
# DBGDEF = \ # DBGDEF = \
# -DDEBUG # -DDEBUG
...@@ -77,7 +76,7 @@ endif ...@@ -77,7 +76,7 @@ endif
# SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources # SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources
# SK_DBGCAT_DRV_EVENT 0x08000000 driver events # SK_DBGCAT_DRV_EVENT 0x08000000 driver events
EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM) EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
clean: clean:
rm -f core *.o *.a *.s rm -f core *.o *.a *.s
......
...@@ -425,10 +425,6 @@ struct s_AC { ...@@ -425,10 +425,6 @@ struct s_AC {
TX_PORT TxPort[SK_MAX_MACS][2]; TX_PORT TxPort[SK_MAX_MACS][2];
RX_PORT RxPort[SK_MAX_MACS]; RX_PORT RxPort[SK_MAX_MACS];
unsigned int CsOfs1; /* for checksum calculation */
unsigned int CsOfs2; /* for checksum calculation */
SK_U32 CsOfs; /* for checksum calculation */
SK_BOOL CheckQueue; /* check event queue soon */ SK_BOOL CheckQueue; /* check event queue soon */
SK_TIMER DrvCleanupTimer;/* to check for pending descriptors */ SK_TIMER DrvCleanupTimer;/* to check for pending descriptors */
DIM_INFO DynIrqModInfo; /* all data related to DIM */ DIM_INFO DynIrqModInfo; /* all data related to DIM */
......
This diff is collapsed.
...@@ -549,4 +549,6 @@ struct ethtool_ops SkGeEthtoolOps = { ...@@ -549,4 +549,6 @@ struct ethtool_ops SkGeEthtoolOps = {
.phys_id = locateDevice, .phys_id = locateDevice,
.get_pauseparam = getPauseParams, .get_pauseparam = getPauseParams,
.set_pauseparam = setPauseParams, .set_pauseparam = setPauseParams,
.get_link = ethtool_op_get_link,
.get_perm_addr = ethtool_op_get_perm_addr,
}; };
This diff is collapsed.
...@@ -2300,14 +2300,12 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) ...@@ -2300,14 +2300,12 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
td->dma_hi = map >> 32; td->dma_hi = map >> 32;
if (skb->ip_summed == CHECKSUM_HW) { if (skb->ip_summed == CHECKSUM_HW) {
const struct iphdr *ip
= (const struct iphdr *) (skb->data + ETH_HLEN);
int offset = skb->h.raw - skb->data; int offset = skb->h.raw - skb->data;
/* This seems backwards, but it is what the sk98lin /* This seems backwards, but it is what the sk98lin
* does. Looks like hardware is wrong? * does. Looks like hardware is wrong?
*/ */
if (ip->protocol == IPPROTO_UDP if (skb->h.ipiph->protocol == IPPROTO_UDP
&& hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
control = BMU_TCP_CHECK; control = BMU_TCP_CHECK;
else else
......
...@@ -2755,8 +2755,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, ...@@ -2755,8 +2755,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
SET_NETDEV_DEV(dev, dmdev); SET_NETDEV_DEV(dev, dmdev);
if (test_bit(FLAG_MPI,&ai->flags)) reset_card (dev, 1);
reset_card (dev, 1); msleep(400);
rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev ); rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
if (rc) { if (rc) {
......
...@@ -3512,9 +3512,8 @@ static int orinoco_ioctl_setpower(struct net_device *dev, ...@@ -3512,9 +3512,8 @@ static int orinoco_ioctl_setpower(struct net_device *dev,
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
}
if (err)
goto out; goto out;
}
if (prq->flags & IW_POWER_TIMEOUT) { if (prq->flags & IW_POWER_TIMEOUT) {
priv->pm_on = 1; priv->pm_on = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment