Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184585
b: refs/heads/master
c: 46976c0
h: refs/heads/master
i:
  184583: 4e42d19
v: v3
  • Loading branch information
David S. Miller committed Feb 28, 2010
1 parent 9d6bae3 commit 854558b
Show file tree
Hide file tree
Showing 46 changed files with 2,594 additions and 356 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6e623a65cb301088bd04794043e82bfc996c512
refs/heads/master: 46976c042ba1ff59253f2f7a513099175c24794e
4 changes: 2 additions & 2 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3502,9 +3502,9 @@ F: drivers/net/mv643xx_eth.*
F: include/linux/mv643xx.h

MARVELL MWL8K WIRELESS DRIVER
M: Lennert Buytenhek <buytenh@marvell.com>
M: Lennert Buytenhek <buytenh@wantstofly.org>
L: linux-wireless@vger.kernel.org
S: Supported
S: Maintained
F: drivers/net/wireless/mwl8k.c

MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
Expand Down
70 changes: 29 additions & 41 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7743,10 +7743,9 @@ bnx2_get_pci_speed(struct bnx2 *bp)
static void __devinit
bnx2_read_vpd_fw_ver(struct bnx2 *bp)
{
int rc, i, v0_len = 0;
int rc, i, j;
u8 *data;
u8 *v0_str = NULL;
bool mn_match = false;
unsigned int block_end, rosize, len;

#define BNX2_VPD_NVRAM_OFFSET 0x300
#define BNX2_VPD_LEN 128
Expand All @@ -7768,53 +7767,42 @@ bnx2_read_vpd_fw_ver(struct bnx2 *bp)
data[i + 3] = data[i + BNX2_VPD_LEN];
}

for (i = 0; i <= BNX2_VPD_LEN - 3; ) {
unsigned char val = data[i];
unsigned int block_end;

if (val == 0x82 || val == 0x91) {
i = (i + 3 + (data[i + 1] + (data[i + 2] << 8)));
continue;
}

if (val != 0x90)
goto vpd_done;
i = pci_vpd_find_tag(data, 0, BNX2_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
if (i < 0)
goto vpd_done;

block_end = (i + 3 + (data[i + 1] + (data[i + 2] << 8)));
i += 3;
rosize = pci_vpd_lrdt_size(&data[i]);
i += PCI_VPD_LRDT_TAG_SIZE;
block_end = i + rosize;

if (block_end > BNX2_VPD_LEN)
goto vpd_done;
if (block_end > BNX2_VPD_LEN)
goto vpd_done;

while (i < (block_end - 2)) {
int len = data[i + 2];
j = pci_vpd_find_info_keyword(data, i, rosize,
PCI_VPD_RO_KEYWORD_MFR_ID);
if (j < 0)
goto vpd_done;

if (i + 3 + len > block_end)
goto vpd_done;
len = pci_vpd_info_field_size(&data[j]);

if (data[i] == 'M' && data[i + 1] == 'N') {
if (len != 4 ||
memcmp(&data[i + 3], "1028", 4))
goto vpd_done;
mn_match = true;
j += PCI_VPD_INFO_FLD_HDR_SIZE;
if (j + len > block_end || len != 4 ||
memcmp(&data[j], "1028", 4))
goto vpd_done;

} else if (data[i] == 'V' && data[i + 1] == '0') {
if (len > BNX2_MAX_VER_SLEN)
goto vpd_done;
j = pci_vpd_find_info_keyword(data, i, rosize,
PCI_VPD_RO_KEYWORD_VENDOR0);
if (j < 0)
goto vpd_done;

v0_len = len;
v0_str = &data[i + 3];
}
i += 3 + len;
len = pci_vpd_info_field_size(&data[j]);

if (mn_match && v0_str) {
memcpy(bp->fw_version, v0_str, v0_len);
bp->fw_version[v0_len] = ' ';
goto vpd_done;
}
}
j += PCI_VPD_INFO_FLD_HDR_SIZE;
if (j + len > block_end || len > BNX2_MAX_VER_SLEN)
goto vpd_done;
}

memcpy(bp->fw_version, &data[j], len);
bp->fw_version[len] = ' ';

vpd_done:
kfree(data);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4946,6 +4946,8 @@ int bond_create(struct net *net, const char *name)
}

res = register_netdevice(bond_dev);
if (res < 0)
goto out_netdev;

out:
rtnl_unlock();
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/net/fs_enet/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
config FS_ENET
tristate "Freescale Ethernet Driver"
depends on CPM1 || CPM2
depends on CPM1 || CPM2 || PPC_MPC512x
select MII
select PHYLIB

config FS_ENET_MPC5121_FEC
def_bool y if (FS_ENET && PPC_MPC512x)
select FS_ENET_HAS_FEC

config FS_ENET_HAS_SCC
bool "Chip has an SCC usable for ethernet"
depends on FS_ENET && (CPM1 || CPM2)
Expand All @@ -16,13 +20,13 @@ config FS_ENET_HAS_FCC

config FS_ENET_HAS_FEC
bool "Chip has an FEC usable for ethernet"
depends on FS_ENET && CPM1
depends on FS_ENET && (CPM1 || FS_ENET_MPC5121_FEC)
select FS_ENET_MDIO_FEC
default y

config FS_ENET_MDIO_FEC
tristate "MDIO driver for FEC"
depends on FS_ENET && CPM1
depends on FS_ENET && (CPM1 || FS_ENET_MPC5121_FEC)

config FS_ENET_MDIO_FCC
tristate "MDIO driver for FCC"
Expand Down
93 changes: 69 additions & 24 deletions trunk/drivers/net/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
* the last indicator should be set.
*/
if ((sc & BD_ENET_RX_LAST) == 0)
printk(KERN_WARNING DRV_MODULE_NAME
": %s rcv is not +last\n",
dev->name);
dev_warn(fep->dev, "rcv is not +last\n");

/*
* Check for errors.
Expand Down Expand Up @@ -178,9 +176,8 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
received++;
netif_receive_skb(skb);
} else {
printk(KERN_WARNING DRV_MODULE_NAME
": %s Memory squeeze, dropping packet.\n",
dev->name);
dev_warn(fep->dev,
"Memory squeeze, dropping packet.\n");
fep->stats.rx_dropped++;
skbn = skb;
}
Expand Down Expand Up @@ -242,9 +239,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
* the last indicator should be set.
*/
if ((sc & BD_ENET_RX_LAST) == 0)
printk(KERN_WARNING DRV_MODULE_NAME
": %s rcv is not +last\n",
dev->name);
dev_warn(fep->dev, "rcv is not +last\n");

/*
* Check for errors.
Expand Down Expand Up @@ -313,9 +308,8 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
received++;
netif_rx(skb);
} else {
printk(KERN_WARNING DRV_MODULE_NAME
": %s Memory squeeze, dropping packet.\n",
dev->name);
dev_warn(fep->dev,
"Memory squeeze, dropping packet.\n");
fep->stats.rx_dropped++;
skbn = skb;
}
Expand Down Expand Up @@ -388,10 +382,10 @@ static void fs_enet_tx(struct net_device *dev)
} else
fep->stats.tx_packets++;

if (sc & BD_ENET_TX_READY)
printk(KERN_WARNING DRV_MODULE_NAME
": %s HEY! Enet xmit interrupt and TX_READY.\n",
dev->name);
if (sc & BD_ENET_TX_READY) {
dev_warn(fep->dev,
"HEY! Enet xmit interrupt and TX_READY.\n");
}

/*
* Deferred means some collisions occurred during transmit,
Expand Down Expand Up @@ -511,9 +505,8 @@ void fs_init_bds(struct net_device *dev)
for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
skb = dev_alloc_skb(ENET_RX_FRSIZE);
if (skb == NULL) {
printk(KERN_WARNING DRV_MODULE_NAME
": %s Memory squeeze, unable to allocate skb\n",
dev->name);
dev_warn(fep->dev,
"Memory squeeze, unable to allocate skb\n");
break;
}
skb_align(skb, ENET_RX_ALIGN);
Expand Down Expand Up @@ -587,6 +580,40 @@ void fs_cleanup_bds(struct net_device *dev)

/**********************************************************************************/

#ifdef CONFIG_FS_ENET_MPC5121_FEC
/*
* MPC5121 FEC requeries 4-byte alignment for TX data buffer!
*/
static struct sk_buff *tx_skb_align_workaround(struct net_device *dev,
struct sk_buff *skb)
{
struct sk_buff *new_skb;
struct fs_enet_private *fep = netdev_priv(dev);

/* Alloc new skb */
new_skb = dev_alloc_skb(skb->len + 4);
if (!new_skb) {
if (net_ratelimit()) {
dev_warn(fep->dev,
"Memory squeeze, dropping tx packet.\n");
}
return NULL;
}

/* Make sure new skb is properly aligned */
skb_align(new_skb, 4);

/* Copy data to new skb ... */
skb_copy_from_linear_data(skb, new_skb->data, skb->len);
skb_put(new_skb, skb->len);

/* ... and free an old one */
dev_kfree_skb_any(skb);

return new_skb;
}
#endif

static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct fs_enet_private *fep = netdev_priv(dev);
Expand All @@ -595,6 +622,19 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
u16 sc;
unsigned long flags;

#ifdef CONFIG_FS_ENET_MPC5121_FEC
if (((unsigned long)skb->data) & 0x3) {
skb = tx_skb_align_workaround(dev, skb);
if (!skb) {
/*
* We have lost packet due to memory allocation error
* in tx_skb_align_workaround(). Hopefully original
* skb is still valid, so try transmit it later.
*/
return NETDEV_TX_BUSY;
}
}
#endif
spin_lock_irqsave(&fep->tx_lock, flags);

/*
Expand All @@ -610,8 +650,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
* Ooops. All transmit buffers are full. Bail out.
* This should not happen, since the tx queue should be stopped.
*/
printk(KERN_WARNING DRV_MODULE_NAME
": %s tx queue full!.\n", dev->name);
dev_warn(fep->dev, "tx queue full!.\n");
return NETDEV_TX_BUSY;
}

Expand Down Expand Up @@ -788,8 +827,7 @@ static int fs_enet_open(struct net_device *dev)
r = request_irq(fep->interrupt, fs_enet_interrupt, IRQF_SHARED,
"fs_enet-mac", dev);
if (r != 0) {
printk(KERN_ERR DRV_MODULE_NAME
": %s Could not allocate FS_ENET IRQ!", dev->name);
dev_err(fep->dev, "Could not allocate FS_ENET IRQ!");
if (fep->fpi->use_napi)
napi_disable(&fep->napi);
return -EINVAL;
Expand Down Expand Up @@ -1053,7 +1091,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
if (ret)
goto out_free_bd;

printk(KERN_INFO "%s: fs_enet: %pM\n", ndev->name, ndev->dev_addr);
pr_info("%s: fs_enet: %pM\n", ndev->name, ndev->dev_addr);

return 0;

Expand Down Expand Up @@ -1103,10 +1141,17 @@ static struct of_device_id fs_enet_match[] = {
},
#endif
#ifdef CONFIG_FS_ENET_HAS_FEC
#ifdef CONFIG_FS_ENET_MPC5121_FEC
{
.compatible = "fsl,mpc5121-fec",
.data = (void *)&fs_fec_ops,
},
#else
{
.compatible = "fsl,pq1-fec-enet",
.data = (void *)&fs_fec_ops,
},
#endif
#endif
{}
};
Expand Down
49 changes: 48 additions & 1 deletion trunk/drivers/net/fs_enet/fs_enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,56 @@

#ifdef CONFIG_CPM1
#include <asm/cpm1.h>
#endif

#if defined(CONFIG_FS_ENET_HAS_FEC)
#include <asm/cpm.h>

#if defined(CONFIG_FS_ENET_MPC5121_FEC)
/* MPC5121 FEC has different register layout */
struct fec {
u32 fec_reserved0;
u32 fec_ievent; /* Interrupt event reg */
u32 fec_imask; /* Interrupt mask reg */
u32 fec_reserved1;
u32 fec_r_des_active; /* Receive descriptor reg */
u32 fec_x_des_active; /* Transmit descriptor reg */
u32 fec_reserved2[3];
u32 fec_ecntrl; /* Ethernet control reg */
u32 fec_reserved3[6];
u32 fec_mii_data; /* MII manage frame reg */
u32 fec_mii_speed; /* MII speed control reg */
u32 fec_reserved4[7];
u32 fec_mib_ctrlstat; /* MIB control/status reg */
u32 fec_reserved5[7];
u32 fec_r_cntrl; /* Receive control reg */
u32 fec_reserved6[15];
u32 fec_x_cntrl; /* Transmit Control reg */
u32 fec_reserved7[7];
u32 fec_addr_low; /* Low 32bits MAC address */
u32 fec_addr_high; /* High 16bits MAC address */
u32 fec_opd; /* Opcode + Pause duration */
u32 fec_reserved8[10];
u32 fec_hash_table_high; /* High 32bits hash table */
u32 fec_hash_table_low; /* Low 32bits hash table */
u32 fec_grp_hash_table_high; /* High 32bits hash table */
u32 fec_grp_hash_table_low; /* Low 32bits hash table */
u32 fec_reserved9[7];
u32 fec_x_wmrk; /* FIFO transmit water mark */
u32 fec_reserved10;
u32 fec_r_bound; /* FIFO receive bound reg */
u32 fec_r_fstart; /* FIFO receive start reg */
u32 fec_reserved11[11];
u32 fec_r_des_start; /* Receive descriptor ring */
u32 fec_x_des_start; /* Transmit descriptor ring */
u32 fec_r_buff_size; /* Maximum receive buff size */
u32 fec_reserved12[26];
u32 fec_dma_control; /* DMA Endian and other ctrl */
};
#endif

struct fec_info {
fec_t __iomem *fecp;
struct fec __iomem *fecp;
u32 mii_speed;
};
#endif
Expand Down
Loading

0 comments on commit 854558b

Please sign in to comment.