Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184576
b: refs/heads/master
c: 8e5b230
h: refs/heads/master
v: v3
  • Loading branch information
Peter Huewe authored and Marcel Holtmann committed Feb 27, 2010
1 parent 357d1ea commit a374fe3
Show file tree
Hide file tree
Showing 47 changed files with 358 additions and 2,596 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: 024c378f0b719d43b01b875caefa19f2612e103a
refs/heads/master: 8e5b2308489dbca27c104fc6a557d4c9348552e5
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@wantstofly.org>
M: Lennert Buytenhek <buytenh@marvell.com>
L: linux-wireless@vger.kernel.org
S: Maintained
S: Supported
F: drivers/net/wireless/mwl8k.c

MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/bluetooth/btmrvl_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ static struct sdio_driver bt_mrvl_sdio = {
.remove = btmrvl_sdio_remove,
};

static int btmrvl_sdio_init_module(void)
static int __init btmrvl_sdio_init_module(void)
{
if (sdio_register_driver(&bt_mrvl_sdio) != 0) {
BT_ERR("SDIO Driver Registration Failed");
Expand All @@ -989,7 +989,7 @@ static int btmrvl_sdio_init_module(void)
return 0;
}

static void btmrvl_sdio_exit_module(void)
static void __exit btmrvl_sdio_exit_module(void)
{
/* Set the flag as user is removing this module. */
user_rmmod = 1;
Expand Down
70 changes: 41 additions & 29 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7743,9 +7743,10 @@ bnx2_get_pci_speed(struct bnx2 *bp)
static void __devinit
bnx2_read_vpd_fw_ver(struct bnx2 *bp)
{
int rc, i, j;
int rc, i, v0_len = 0;
u8 *data;
unsigned int block_end, rosize, len;
u8 *v0_str = NULL;
bool mn_match = false;

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

i = pci_vpd_find_tag(data, 0, BNX2_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
if (i < 0)
goto vpd_done;
for (i = 0; i <= BNX2_VPD_LEN - 3; ) {
unsigned char val = data[i];
unsigned int block_end;

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

if (block_end > BNX2_VPD_LEN)
goto vpd_done;
if (val != 0x90)
goto vpd_done;

j = pci_vpd_find_info_keyword(data, i, rosize,
PCI_VPD_RO_KEYWORD_MFR_ID);
if (j < 0)
goto vpd_done;
block_end = (i + 3 + (data[i + 1] + (data[i + 2] << 8)));
i += 3;

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

j += PCI_VPD_INFO_FLD_HDR_SIZE;
if (j + len > block_end || len != 4 ||
memcmp(&data[j], "1028", 4))
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_VENDOR0);
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 > BNX2_MAX_VER_SLEN)
goto vpd_done;
} else if (data[i] == 'V' && data[i + 1] == '0') {
if (len > BNX2_MAX_VER_SLEN)
goto vpd_done;

v0_len = len;
v0_str = &data[i + 3];
}
i += 3 + len;

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

vpd_done:
kfree(data);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4946,8 +4946,6 @@ 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: 3 additions & 7 deletions trunk/drivers/net/fs_enet/Kconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
config FS_ENET
tristate "Freescale Ethernet Driver"
depends on CPM1 || CPM2 || PPC_MPC512x
depends on CPM1 || CPM2
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 @@ -20,13 +16,13 @@ config FS_ENET_HAS_FCC

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

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

config FS_ENET_MDIO_FCC
tristate "MDIO driver for FCC"
Expand Down
93 changes: 24 additions & 69 deletions trunk/drivers/net/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ 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)
dev_warn(fep->dev, "rcv is not +last\n");
printk(KERN_WARNING DRV_MODULE_NAME
": %s rcv is not +last\n",
dev->name);

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

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

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

/*
* Deferred means some collisions occurred during transmit,
Expand Down Expand Up @@ -505,8 +511,9 @@ 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) {
dev_warn(fep->dev,
"Memory squeeze, unable to allocate skb\n");
printk(KERN_WARNING DRV_MODULE_NAME
": %s Memory squeeze, unable to allocate skb\n",
dev->name);
break;
}
skb_align(skb, ENET_RX_ALIGN);
Expand Down Expand Up @@ -580,40 +587,6 @@ 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 @@ -622,19 +595,6 @@ 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 @@ -650,7 +610,8 @@ 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.
*/
dev_warn(fep->dev, "tx queue full!.\n");
printk(KERN_WARNING DRV_MODULE_NAME
": %s tx queue full!.\n", dev->name);
return NETDEV_TX_BUSY;
}

Expand Down Expand Up @@ -827,7 +788,8 @@ 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) {
dev_err(fep->dev, "Could not allocate FS_ENET IRQ!");
printk(KERN_ERR DRV_MODULE_NAME
": %s Could not allocate FS_ENET IRQ!", dev->name);
if (fep->fpi->use_napi)
napi_disable(&fep->napi);
return -EINVAL;
Expand Down Expand Up @@ -1091,7 +1053,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
if (ret)
goto out_free_bd;

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

return 0;

Expand Down Expand Up @@ -1141,17 +1103,10 @@ 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
Loading

0 comments on commit a374fe3

Please sign in to comment.