Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231193
b: refs/heads/master
c: 6cae913
h: refs/heads/master
i:
  231191: 96ce239
v: v3
  • Loading branch information
Sujith Manoharan authored and John W. Linville committed Jan 10, 2011
1 parent be07783 commit 3be1632
Show file tree
Hide file tree
Showing 71 changed files with 334 additions and 503 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: 72b43d0898e97f588293b4a24b33c58c46633d81
refs/heads/master: 6cae913d6c06557fee81aa8a181eafcc9a76516a
8 changes: 8 additions & 0 deletions trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,14 @@ config FEC
Say Y here if you want to use the built-in 10/100 Fast ethernet
controller on some Motorola ColdFire and Freescale i.MX processors.

config FEC2
bool "Second FEC ethernet controller"
depends on FEC
help
Say Y here if you want to use the second built-in 10/100 Fast
ethernet controller on some Motorola ColdFire and Freescale
i.MX processors.

config FEC_MPC52xx
tristate "MPC52xx FEC driver"
depends on PPC_MPC52xx && PPC_BESTCOMM
Expand Down
76 changes: 38 additions & 38 deletions trunk/drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
* Licensed under the GPL-2 or later.
*/

#define DRV_VERSION "1.1"
#define DRV_DESC "Blackfin on-chip Ethernet MAC driver"

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -46,7 +41,12 @@

#include "bfin_mac.h"

MODULE_AUTHOR("Bryan Wu, Luke Yang");
#define DRV_NAME "bfin_mac"
#define DRV_VERSION "1.1"
#define DRV_AUTHOR "Bryan Wu, Luke Yang"
#define DRV_DESC "Blackfin on-chip Ethernet MAC driver"

MODULE_AUTHOR(DRV_AUTHOR);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION(DRV_DESC);
MODULE_ALIAS("platform:bfin_mac");
Expand Down Expand Up @@ -189,7 +189,8 @@ static int desc_list_init(void)
/* allocate a new skb for next time receive */
new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN);
if (!new_skb) {
pr_notice("init: low on mem - packet dropped\n");
printk(KERN_NOTICE DRV_NAME
": init: low on mem - packet dropped\n");
goto init_error;
}
skb_reserve(new_skb, NET_IP_ALIGN);
Expand Down Expand Up @@ -239,7 +240,7 @@ static int desc_list_init(void)

init_error:
desc_list_free();
pr_err("kmalloc failed\n");
printk(KERN_ERR DRV_NAME ": kmalloc failed\n");
return -ENOMEM;
}

Expand All @@ -258,7 +259,8 @@ static int bfin_mdio_poll(void)
while ((bfin_read_EMAC_STAADD()) & STABUSY) {
udelay(1);
if (timeout_cnt-- < 0) {
pr_err("wait MDC/MDIO transaction to complete timeout\n");
printk(KERN_ERR DRV_NAME
": wait MDC/MDIO transaction to complete timeout\n");
return -ETIMEDOUT;
}
}
Expand Down Expand Up @@ -348,9 +350,9 @@ static void bfin_mac_adjust_link(struct net_device *dev)
opmode &= ~RMII_10;
break;
default:
netdev_warn(dev,
"Ack! Speed (%d) is not 10/100!\n",
phydev->speed);
printk(KERN_WARNING
"%s: Ack! Speed (%d) is not 10/100!\n",
DRV_NAME, phydev->speed);
break;
}
bfin_write_EMAC_OPMODE(opmode);
Expand Down Expand Up @@ -415,21 +417,22 @@ static int mii_probe(struct net_device *dev, int phy_mode)

/* now we are supposed to have a proper phydev, to attach to... */
if (!phydev) {
netdev_err(dev, "no phy device found\n");
printk(KERN_INFO "%s: Don't found any phy device at all\n",
dev->name);
return -ENODEV;
}

if (phy_mode != PHY_INTERFACE_MODE_RMII &&
phy_mode != PHY_INTERFACE_MODE_MII) {
netdev_err(dev, "invalid phy interface mode\n");
printk(KERN_INFO "%s: Invalid phy interface mode\n", dev->name);
return -EINVAL;
}

phydev = phy_connect(dev, dev_name(&phydev->dev), &bfin_mac_adjust_link,
0, phy_mode);

if (IS_ERR(phydev)) {
netdev_err(dev, "could not attach PHY\n");
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
}

Expand All @@ -450,10 +453,11 @@ static int mii_probe(struct net_device *dev, int phy_mode)
lp->old_duplex = -1;
lp->phydev = phydev;

pr_info("attached PHY driver [%s] "
"(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)@sclk=%dMHz)\n",
phydev->drv->name, dev_name(&phydev->dev), phydev->irq,
MDC_CLK, mdc_div, sclk/1000000);
printk(KERN_INFO "%s: attached PHY driver [%s] "
"(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
"@sclk=%dMHz)\n",
DRV_NAME, phydev->drv->name, dev_name(&phydev->dev), phydev->irq,
MDC_CLK, mdc_div, sclk/1000000);

return 0;
}
Expand Down Expand Up @@ -498,7 +502,7 @@ bfin_mac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
strcpy(info->driver, KBUILD_MODNAME);
strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION);
strcpy(info->fw_version, "N/A");
strcpy(info->bus_info, dev_name(&dev->dev));
Expand Down Expand Up @@ -558,7 +562,7 @@ static const struct ethtool_ops bfin_mac_ethtool_ops = {
};

/**************************************************************************/
static void setup_system_regs(struct net_device *dev)
void setup_system_regs(struct net_device *dev)
{
struct bfin_mac_local *lp = netdev_priv(dev);
int i;
Expand Down Expand Up @@ -588,10 +592,6 @@ static void setup_system_regs(struct net_device *dev)

bfin_write_EMAC_MMC_CTL(RSTC | CROLL);

/* Set vlan regs to let 1522 bytes long packets pass through */
bfin_write_EMAC_VLAN1(lp->vlan1_mask);
bfin_write_EMAC_VLAN2(lp->vlan2_mask);

/* Initialize the TX DMA channel registers */
bfin_write_DMA2_X_COUNT(0);
bfin_write_DMA2_X_MODIFY(4);
Expand Down Expand Up @@ -827,7 +827,8 @@ static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb)
while ((!(bfin_read_EMAC_PTP_ISTAT() & TXTL)) && (--timeout_cnt))
udelay(1);
if (timeout_cnt == 0)
netdev_err(netdev, "timestamp the TX packet failed\n");
printk(KERN_ERR DRV_NAME
": fails to timestamp the TX packet\n");
else {
struct skb_shared_hwtstamps shhwtstamps;
u64 ns;
Expand Down Expand Up @@ -1082,7 +1083,8 @@ static void bfin_mac_rx(struct net_device *dev)
* we which case we simply drop the packet
*/
if (current_rx_ptr->status.status_word & RX_ERROR_MASK) {
netdev_notice(dev, "rx: receive error - packet dropped\n");
printk(KERN_NOTICE DRV_NAME
": rx: receive error - packet dropped\n");
dev->stats.rx_dropped++;
goto out;
}
Expand All @@ -1092,7 +1094,8 @@ static void bfin_mac_rx(struct net_device *dev)

new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN);
if (!new_skb) {
netdev_notice(dev, "rx: low on mem - packet dropped\n");
printk(KERN_NOTICE DRV_NAME
": rx: low on mem - packet dropped\n");
dev->stats.rx_dropped++;
goto out;
}
Expand Down Expand Up @@ -1210,7 +1213,7 @@ static int bfin_mac_enable(struct phy_device *phydev)
int ret;
u32 opmode;

pr_debug("%s\n", __func__);
pr_debug("%s: %s\n", DRV_NAME, __func__);

/* Set RX DMA */
bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a));
Expand Down Expand Up @@ -1293,7 +1296,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
addrs = ha->addr;

/* skip non-multicast addresses */
if (!is_multicast_ether_addr(addrs))
if (!(*addrs & 1))
continue;

crc = ether_crc(ETH_ALEN, addrs);
Expand All @@ -1320,7 +1323,7 @@ static void bfin_mac_set_multicast_list(struct net_device *dev)
u32 sysctl;

if (dev->flags & IFF_PROMISC) {
netdev_info(dev, "set promisc mode\n");
printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
sysctl = bfin_read_EMAC_OPMODE();
sysctl |= PR;
bfin_write_EMAC_OPMODE(sysctl);
Expand Down Expand Up @@ -1390,7 +1393,7 @@ static int bfin_mac_open(struct net_device *dev)
* address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
*/
if (!is_valid_ether_addr(dev->dev_addr)) {
netdev_warn(dev, "no valid ethernet hw addr\n");
printk(KERN_WARNING DRV_NAME ": no valid ethernet hw addr\n");
return -EINVAL;
}

Expand Down Expand Up @@ -1524,9 +1527,6 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
goto out_err_mii_probe;
}

lp->vlan1_mask = ETH_P_8021Q | mii_bus_data->vlan1_mask;
lp->vlan2_mask = ETH_P_8021Q | mii_bus_data->vlan2_mask;

/* Fill in the fields of the device structure with ethernet values. */
ether_setup(ndev);

Expand Down Expand Up @@ -1558,7 +1558,7 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
bfin_mac_hwtstamp_init(ndev);

/* now, print out the card info, in a short format.. */
netdev_info(ndev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);
dev_info(&pdev->dev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);

return 0;

Expand Down Expand Up @@ -1650,7 +1650,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
* so set the GPIO pins to Ethernet mode
*/
pin_req = mii_bus_pd->mac_peripherals;
rc = peripheral_request_list(pin_req, KBUILD_MODNAME);
rc = peripheral_request_list(pin_req, DRV_NAME);
if (rc) {
dev_err(&pdev->dev, "Requesting peripherals failed!\n");
return rc;
Expand Down Expand Up @@ -1739,7 +1739,7 @@ static struct platform_driver bfin_mac_driver = {
.resume = bfin_mac_resume,
.suspend = bfin_mac_suspend,
.driver = {
.name = KBUILD_MODNAME,
.name = DRV_NAME,
.owner = THIS_MODULE,
},
};
Expand Down
11 changes: 1 addition & 10 deletions trunk/drivers/net/bfin_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@
#include <linux/etherdevice.h>
#include <linux/bfin_mac.h>

/*
* Disable hardware checksum for bug #5600 if writeback cache is
* enabled. Otherwize, corrupted RX packet will be sent up stack
* without error mark.
*/
#ifndef CONFIG_BFIN_EXTMEM_WRITEBACK
#define BFIN_MAC_CSUM_OFFLOAD
#endif

#define TX_RECLAIM_JIFFIES (HZ / 5)

Expand Down Expand Up @@ -75,16 +68,14 @@ struct bfin_mac_local {
*/
struct net_device_stats stats;

unsigned char Mac[6]; /* MAC address of the board */
spinlock_t lock;

int wol; /* Wake On Lan */
int irq_wake_requested;
struct timer_list tx_reclaim_timer;
struct net_device *ndev;

/* Data for EMAC_VLAN1 regs */
u16 vlan1_mask, vlan2_mask;

/* MII and PHY stuffs */
int old_link; /* used by bf537_adjust_link */
int old_speed;
Expand Down
15 changes: 5 additions & 10 deletions trunk/drivers/net/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,19 +749,13 @@ static int cxgb4vf_open(struct net_device *dev)
netif_set_real_num_tx_queues(dev, pi->nqsets);
err = netif_set_real_num_rx_queues(dev, pi->nqsets);
if (err)
goto err_unwind;
return err;
set_bit(pi->port_id, &adapter->open_device_map);
err = link_start(dev);
if (err)
goto err_unwind;

return err;
netif_tx_start_all_queues(dev);
set_bit(pi->port_id, &adapter->open_device_map);
return 0;

err_unwind:
if (adapter->open_device_map == 0)
adapter_down(adapter);
return err;
}

/*
Expand All @@ -770,12 +764,13 @@ static int cxgb4vf_open(struct net_device *dev)
*/
static int cxgb4vf_stop(struct net_device *dev)
{
int ret;
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;

netif_tx_stop_all_queues(dev);
netif_carrier_off(dev);
t4vf_enable_vi(adapter, pi->viid, false, false);
ret = t4vf_enable_vi(adapter, pi->viid, false, false);
pi->link_cfg.link_ok = 0;

clear_bit(pi->port_id, &adapter->open_device_map);
Expand Down
11 changes: 0 additions & 11 deletions trunk/drivers/net/cxgb4vf/t4vf_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,9 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
/*
* Write the command array into the Mailbox Data register array and
* transfer ownership of the mailbox to the firmware.
*
* For the VFs, the Mailbox Data "registers" are actually backed by
* T4's "MA" interface rather than PL Registers (as is the case for
* the PFs). Because these are in different coherency domains, the
* write to the VF's PL-register-backed Mailbox Control can race in
* front of the writes to the MA-backed VF Mailbox Data "registers".
* So we need to do a read-back on at least one byte of the VF Mailbox
* Data registers before doing the write to the VF Mailbox Control
* register.
*/
for (i = 0, p = cmd; i < size; i += 8)
t4_write_reg64(adapter, mbox_data + i, be64_to_cpu(*p++));
t4_read_reg(adapter, mbox_data); /* flush write */

t4_write_reg(adapter, mbox_ctl,
MBMSGVALID | MBOWNER(MBOX_OWNER_FW));
t4_read_reg(adapter, mbox_ctl); /* flush write */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0107"
#define DRV_VERSION "EHEA_0106"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a)
}
}
/* Ring doorbell */
ehea_update_rq1a(pr->qp, i - 1);
ehea_update_rq1a(pr->qp, i);
}

static int ehea_refill_rq_def(struct ehea_port_res *pr,
Expand Down Expand Up @@ -1329,7 +1329,9 @@ static int ehea_fill_port_res(struct ehea_port_res *pr)
int ret;
struct ehea_qp_init_attr *init_attr = &pr->qp->init_attr;

ehea_init_fill_rq1(pr, pr->rq1_skba.len);
ehea_init_fill_rq1(pr, init_attr->act_nr_rwqes_rq1
- init_attr->act_nr_rwqes_rq2
- init_attr->act_nr_rwqes_rq3 - 1);

ret = ehea_refill_rq2(pr, init_attr->act_nr_rwqes_rq2 - 1);

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/mlx4/en_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
int i;
int err;

dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv),
prof->tx_ring_num, prof->rx_ring_num);
dev = alloc_etherdev_mq(sizeof(struct mlx4_en_priv), prof->tx_ring_num);
if (dev == NULL) {
mlx4_err(mdev, "Net device allocation failed\n");
return -ENOMEM;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/pcmcia/pcnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2),
PCMCIA_DEVICE_PROD_ID12("corega", "Ether CF-TD", 0x0a21501a, 0x6589340a),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether CF-TD LAN Card", 0x5261440f, 0x8797663b),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
Expand Down
Loading

0 comments on commit 3be1632

Please sign in to comment.