Commit 0a01707b authored by Linus Torvalds's avatar Linus Torvalds

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

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (43 commits)
  [wireless] zd1211rw: workqueue-related build fixes
  [netdrvr] netxen: workqueue-related build fixes
  [PATCH] sky2: sparse warnings
  [PATCH] skge: fix sparse warnings
  [PATCH] myri10ge: write as 2 32-byte blocks in myri10ge_submit_8rx
  [PATCH] sky2: receive queue watermark tweak
  [PATCH] sky2: beter ram buffer partitioning
  [PATCH] sky2: add comments to PCI ids
  [PATCH] sky2: add PCI for 88ec033
  [PATCH] AT91RM9200 Ethernet: Use dev_alloc_skb()
  [PATCH] AT91RM9200 Ethernet: Add netpoll / netconsole support
  [PATCH] AT91RM9200 Ethernet: Move check_timer variable and use mod_timer()
  [PATCH] AT91RM9200 Ethernet: Remove 'at91_dev' and use netdev_priv()
  [PATCH] ipw2200: Fix debug output endian issue
  [PATCH] ipw2200: Fix a typo
  [PATCH] ipw2200: Update version stamp to 1.2.0
  [PATCH] ipw2200: Add IEEE80211_RADIOTAP_TSFT for promiscuous mode
  [PATCH] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme
  [PATCH] softmac: Fixed handling of deassociation from AP
  [PATCH] ipw2200: replace kmalloc+memset with kcalloc
  ...
parents 2685b267 0ae85135
......@@ -922,7 +922,7 @@ int __init init_module(void)
* and then free up the resources we took when the card was found.
*/
void cleanup_module(void)
void __exit cleanup_module(void)
{
struct net_device *dev = dev_3c501;
unregister_netdev(dev);
......
......@@ -726,7 +726,7 @@ static void cleanup_card(struct net_device *dev)
iounmap(ei_status.mem);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -1670,7 +1670,7 @@ int __init init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -940,7 +940,7 @@ int __init init_module(void)
return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0;
}
void
void __exit
cleanup_module(void)
{
struct net_device *dev = dev_3c507;
......
......@@ -1302,7 +1302,7 @@ int __init init_module(void)
} else return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
for (this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
......
......@@ -1659,7 +1659,7 @@ int __init init_module(void)
* transmit operations are allowed to start scribbling into memory.
*/
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(this_device);
cleanup_card(this_device);
......
......@@ -405,7 +405,7 @@ static void cleanup_card(struct net_device *dev)
iounmap(ei_status.mem);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -568,7 +568,7 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
#ifdef MODULE
static struct net_device *apne_dev;
int init_module(void)
int __init init_module(void)
{
apne_dev = apne_probe(-1);
if (IS_ERR(apne_dev))
......@@ -576,7 +576,7 @@ int init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(apne_dev);
......
......@@ -1041,7 +1041,7 @@ int __init init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(cops_dev);
cleanup_card(cops_dev);
......
This diff is collapsed.
......@@ -87,6 +87,7 @@ struct at91_private
spinlock_t lock; /* lock for MDI interface */
short phy_media; /* media interface type */
unsigned short phy_address; /* 5-bit MDI address of PHY (0..31) */
struct timer_list check_timer; /* Poll link status */
/* Transmit */
struct sk_buff *skb; /* holds skb until xmit interrupt completes */
......
......@@ -254,7 +254,7 @@ ether1_readbuffer (struct net_device *dev, void *data, unsigned int start, unsig
} while (thislen);
}
static int __init
static int __devinit
ether1_ramtest(struct net_device *dev, unsigned char byte)
{
unsigned char *buffer = kmalloc (BUFFER_SIZE, GFP_KERNEL);
......@@ -308,7 +308,7 @@ ether1_reset (struct net_device *dev)
return BUS_16;
}
static int __init
static int __devinit
ether1_init_2(struct net_device *dev)
{
int i;
......@@ -986,7 +986,7 @@ ether1_setmulticastlist (struct net_device *dev)
/* ------------------------------------------------------------------------- */
static void __init ether1_banner(void)
static void __devinit ether1_banner(void)
{
static unsigned int version_printed = 0;
......
......@@ -198,7 +198,7 @@ static inline void ether3_ledon(struct net_device *dev)
* Read the ethernet address string from the on board rom.
* This is an ascii string!!!
*/
static int __init
static int __devinit
ether3_addr(char *addr, struct expansion_card *ec)
{
struct in_chunk_dir cd;
......@@ -223,7 +223,7 @@ ether3_addr(char *addr, struct expansion_card *ec)
/* --------------------------------------------------------------------------- */
static int __init
static int __devinit
ether3_ramtest(struct net_device *dev, unsigned char byte)
{
unsigned char *buffer = kmalloc(RX_END, GFP_KERNEL);
......@@ -272,7 +272,7 @@ ether3_ramtest(struct net_device *dev, unsigned char byte)
/* ------------------------------------------------------------------------------- */
static int __init ether3_init_2(struct net_device *dev)
static int __devinit ether3_init_2(struct net_device *dev)
{
int i;
......@@ -765,7 +765,7 @@ static void ether3_tx(struct net_device *dev)
}
}
static void __init ether3_banner(void)
static void __devinit ether3_banner(void)
{
static unsigned version_printed = 0;
......
......@@ -908,7 +908,7 @@ int __init init_module(void)
return 0;
}
void
void __exit
cleanup_module(void)
{
unregister_netdev(dev_at1700);
......
......@@ -1179,7 +1179,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
#ifdef MODULE
static struct net_device *atarilance_dev;
int init_module(void)
int __init init_module(void)
{
atarilance_dev = atarilance_probe(-1);
if (IS_ERR(atarilance_dev))
......@@ -1187,7 +1187,7 @@ int init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(atarilance_dev);
free_irq(atarilance_dev->irq, atarilance_dev);
......
......@@ -3684,7 +3684,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
mii->val_out = 0;
read_lock_bh(&bond->lock);
read_lock(&bond->curr_slave_lock);
if (bond->curr_active_slave) {
if (netif_carrier_ok(bond->dev)) {
mii->val_out = BMSR_LSTATUS;
}
read_unlock(&bond->curr_slave_lock);
......
......@@ -1974,7 +1974,7 @@ int __init init_module(void)
return ret;
}
void
void __exit
cleanup_module(void)
{
unregister_netdev(dev_cs89x0);
......
This diff is collapsed.
......@@ -463,7 +463,7 @@ static void cleanup_card(struct net_device *dev)
release_region(dev->base_addr, E21_IO_EXTENT);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -1827,7 +1827,7 @@ int __init init_module(void)
return n_eepro ? 0 : -ENODEV;
}
void
void __exit
cleanup_module(void)
{
int i;
......
......@@ -1719,7 +1719,7 @@ int __init init_module(void)
return -ENXIO;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -455,7 +455,7 @@ static void cleanup_card(struct net_device *dev)
iounmap(ei_status.mem);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -1475,7 +1475,7 @@ int __init init_module(void)
return -ENXIO;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -482,7 +482,7 @@ static void cleanup_card(struct net_device *dev)
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -444,7 +444,7 @@ static void cleanup_card(struct net_device *dev)
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
......@@ -368,7 +368,7 @@ static void cleanup_card(struct net_device *dev)
kfree(lp);
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -440,7 +440,7 @@ static void cleanup_card(struct net_device *dev)
iounmap(ei_status.mem);
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -1100,7 +1100,7 @@ static void eth_tx_fill_frag_descs(struct mv643xx_private *mp,
ETH_TX_ENABLE_INTERRUPT;
mp->tx_skb[tx_index] = skb;
} else
mp->tx_skb[tx_index] = 0;
mp->tx_skb[tx_index] = NULL;
desc = &mp->p_tx_desc_area[tx_index];
desc->l4i_chk = 0;
......@@ -1136,7 +1136,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
eth_tx_fill_frag_descs(mp, skb);
length = skb_headlen(skb);
mp->tx_skb[tx_index] = 0;
mp->tx_skb[tx_index] = NULL;
} else {
cmd_sts |= ETH_ZERO_PADDING |
ETH_TX_LAST_DESC |
......
......@@ -184,7 +184,7 @@ static int m147lance_close(struct net_device *dev)
MODULE_LICENSE("GPL");
static struct net_device *dev_mvme147_lance;
int init_module(void)
int __init init_module(void)
{
dev_mvme147_lance = mvme147lance_probe(-1);
if (IS_ERR(dev_mvme147_lance))
......@@ -192,7 +192,7 @@ int init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
struct m147lance_private *lp = dev_mvme147_lance->priv;
unregister_netdev(dev_mvme147_lance);
......
This diff is collapsed.
......@@ -6,23 +6,23 @@
/* 8 Bytes */
struct mcp_dma_addr {
u32 high;
u32 low;
__be32 high;
__be32 low;
};
/* 4 Bytes */
struct mcp_slot {
u16 checksum;
u16 length;
__sum16 checksum;
__be16 length;
};
/* 64 Bytes */
struct mcp_cmd {
u32 cmd;
u32 data0; /* will be low portion if data > 32 bits */
__be32 cmd;
__be32 data0; /* will be low portion if data > 32 bits */
/* 8 */
u32 data1; /* will be high portion if data > 32 bits */
u32 data2; /* currently unused.. */
__be32 data1; /* will be high portion if data > 32 bits */
__be32 data2; /* currently unused.. */
/* 16 */
struct mcp_dma_addr response_addr;
/* 24 */
......@@ -31,8 +31,8 @@ struct mcp_cmd {
/* 8 Bytes */
struct mcp_cmd_response {
u32 data;
u32 result;
__be32 data;
__be32 result;
};
/*
......@@ -73,10 +73,10 @@ union mcp_pso_or_cumlen {
/* 16 Bytes */
struct mcp_kreq_ether_send {
u32 addr_high;
u32 addr_low;
u16 pseudo_hdr_offset;
u16 length;
__be32 addr_high;
__be32 addr_low;
__be16 pseudo_hdr_offset;
__be16 length;
u8 pad;
u8 rdma_count;
u8 cksum_offset; /* where to start computing cksum */
......@@ -85,8 +85,8 @@ struct mcp_kreq_ether_send {
/* 8 Bytes */
struct mcp_kreq_ether_recv {
u32 addr_high;
u32 addr_low;
__be32 addr_high;
__be32 addr_low;
};
/* Commands */
......@@ -219,19 +219,19 @@ enum myri10ge_mcp_cmd_status {
struct mcp_irq_data {
/* add new counters at the beginning */
u32 future_use[5];
u32 dropped_multicast_filtered;
__be32 future_use[5];
__be32 dropped_multicast_filtered;
/* 40 Bytes */
u32 send_done_count;
u32 link_up;
u32 dropped_link_overflow;
u32 dropped_link_error_or_filtered;
u32 dropped_runt;
u32 dropped_overrun;
u32 dropped_no_small_buffer;
u32 dropped_no_big_buffer;
u32 rdma_tags_available;
__be32 send_done_count;
__be32 link_up;
__be32 dropped_link_overflow;
__be32 dropped_link_error_or_filtered;
__be32 dropped_runt;
__be32 dropped_overrun;
__be32 dropped_no_small_buffer;
__be32 dropped_no_big_buffer;
__be32 rdma_tags_available;
u8 tx_stopped;
u8 link_down;
......
......@@ -36,7 +36,7 @@
struct mcp_gen_header {
/* the first 4 fields are filled at compile time */
unsigned header_length;
unsigned mcp_type;
__be32 mcp_type;
char version[128];
unsigned mcp_globals; /* pointer to mcp-type specific structure */
......
......@@ -867,7 +867,7 @@ static void cleanup_card(struct net_device *dev)
release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
......@@ -813,7 +813,7 @@ static void cleanup_card(struct net_device *dev)
release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
int this_dev;
......
This diff is collapsed.
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......@@ -118,7 +118,7 @@ netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
u32 fw_minor = 0;
u32 fw_build = 0;
strncpy(drvinfo->driver, "netxen_nic", 32);
strncpy(drvinfo->driver, netxen_nic_driver_name, 32);
strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32);
fw_major = readl(NETXEN_CRB_NORMALIZE(adapter,
NETXEN_FW_VERSION_MAJOR));
......@@ -210,7 +210,6 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
printk(KERN_ERR "netxen-nic: Unsupported board model %d\n",
(netxen_brdtype_t) boardinfo->board_type);
return -EIO;
}
return 0;
......@@ -226,18 +225,18 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
/* read which mode */
if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
/* autonegotiation */
if (adapter->ops->phy_write
&& adapter->ops->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
(__le32) ecmd->autoneg) != 0)
if (adapter->phy_write
&& adapter->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
(__le32) ecmd->autoneg) != 0)
return -EIO;
else
port->link_autoneg = ecmd->autoneg;
if (adapter->ops->phy_read
&& adapter->ops->phy_read(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0)
if (adapter->phy_read
&& adapter->phy_read(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0)
return -EIO;
/* speed */
......@@ -257,10 +256,10 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
netxen_clear_phy_duplex(status);
if (ecmd->duplex == DUPLEX_FULL)
netxen_set_phy_duplex(status);
if (adapter->ops->phy_write
&& adapter->ops->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
*((int *)&status)) != 0)
if (adapter->phy_write
&& adapter->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
*((int *)&status)) != 0)
return -EIO;
else {
port->link_speed = ecmd->speed;
......@@ -422,10 +421,10 @@ static u32 netxen_nic_get_link(struct net_device *dev)
/* read which mode */
if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
if (adapter->ops->phy_read
&& adapter->ops->phy_read(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0)
if (adapter->phy_read
&& adapter->phy_read(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0)
return -EIO;
else
return (netxen_get_phy_link(status));
......@@ -460,20 +459,22 @@ netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
{
struct netxen_port *port = netdev_priv(dev);
struct netxen_adapter *adapter = port->adapter;
int i, j;
int i;
ring->rx_pending = 0;
ring->rx_jumbo_pending = 0;
for (i = 0; i < MAX_RCV_CTX; ++i) {
for (j = 0; j < NUM_RCV_DESC_RINGS; j++)
ring->rx_pending +=
adapter->recv_ctx[i].rcv_desc[j].rcv_pending;
ring->rx_pending += adapter->recv_ctx[i].
rcv_desc[RCV_DESC_NORMAL_CTXID].rcv_pending;
ring->rx_jumbo_pending += adapter->recv_ctx[i].
rcv_desc[RCV_DESC_JUMBO_CTXID].rcv_pending;
}
ring->rx_max_pending = adapter->max_rx_desc_count;
ring->tx_max_pending = adapter->max_tx_desc_count;
ring->rx_jumbo_max_pending = adapter->max_jumbo_rx_desc_count;
ring->rx_mini_max_pending = 0;
ring->rx_mini_pending = 0;
ring->rx_jumbo_max_pending = 0;
ring->rx_jumbo_pending = 0;
}
......@@ -526,10 +527,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
*(u32 *) (&val));
/* set autoneg */
autoneg = pause->autoneg;
if (adapter->ops->phy_write
&& adapter->ops->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
(__le32) autoneg) != 0)
if (adapter->phy_write
&& adapter->phy_write(adapter, port->portnum,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
(__le32) autoneg) != 0)
return -EIO;
else {
port->link_autoneg = pause->autoneg;
......
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
......@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......
This diff is collapsed.
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
......@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......@@ -83,8 +83,8 @@ struct netxen_adapter;
#define NETXEN_PCI_MAPSIZE_BYTES (NETXEN_PCI_MAPSIZE << 20)
#define NETXEN_NIC_LOCKED_READ_REG(X, Y) \
addr = pci_base_offset(adapter, (X)); \
*(u32 *)Y = readl(addr);
addr = pci_base_offset(adapter, X); \
*(u32 *)Y = readl((void __iomem*) addr);
struct netxen_port;
void netxen_nic_set_link_parameters(struct netxen_port *port);
......
This diff is collapsed.
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
......@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......@@ -36,7 +36,7 @@
#define NETXEN_NIC_CMD (NETXEN_CMD_START + 1)
#define NETXEN_NIC_NAME (NETXEN_CMD_START + 2)
#define NETXEN_NIC_NAME_LEN 16
#define NETXEN_NIC_NAME_RSP "NETXEN"
#define NETXEN_NIC_NAME_RSP "NETXEN-UNM"
typedef enum {
netxen_nic_cmd_none = 0,
......
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
......@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......@@ -68,8 +68,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno,
u32 link)
{
struct netxen_port *pport = adapter->port[portno];
struct net_device *netdev = pport->netdev;
struct net_device *netdev = (adapter->port[portno])->netdev;
if (link)
netif_carrier_on(netdev);
......@@ -84,46 +83,41 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
struct netxen_port *port;
/* This should clear the interrupt source */
if (adapter->ops->phy_read)
adapter->ops->phy_read(adapter, portno,
NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
&int_src);
if (adapter->phy_read)
adapter->phy_read(adapter, portno,
NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
&int_src);
if (int_src == 0) {
DPRINTK(INFO, "No phy interrupts for port #%d\n", portno);
return;
}
if (adapter->ops->disable_phy_interrupts)
adapter->ops->disable_phy_interrupts(adapter, portno);
if (adapter->disable_phy_interrupts)
adapter->disable_phy_interrupts(adapter, portno);
port = adapter->port[portno];
if (netxen_get_phy_int_jabber(int_src))
DPRINTK(INFO, "NetXen: %s Jabber interrupt \n",
port->netdev->name);
DPRINTK(INFO, "Jabber interrupt \n");
if (netxen_get_phy_int_polarity_changed(int_src))
DPRINTK(INFO, "NetXen: %s POLARITY CHANGED int \n",
port->netdev->name);
DPRINTK(INFO, "POLARITY CHANGED int \n");
if (netxen_get_phy_int_energy_detect(int_src))
DPRINTK(INFO, "NetXen: %s ENERGY DETECT INT \n",
port->netdev->name);
DPRINTK(INFO, "ENERGY DETECT INT \n");
if (netxen_get_phy_int_downshift(int_src))
DPRINTK(INFO, "NetXen: %s DOWNSHIFT INT \n",
port->netdev->name);
DPRINTK(INFO, "DOWNSHIFT INT \n");
/* write it down later.. */
if ((netxen_get_phy_int_speed_changed(int_src))
|| (netxen_get_phy_int_link_status_changed(int_src))) {
__le32 status;
DPRINTK(INFO, "NetXen: %s SPEED CHANGED OR"
" LINK STATUS CHANGED \n", port->netdev->name);
DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n");
if (adapter->ops->phy_read
&& adapter->ops->phy_read(adapter, portno,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) == 0) {
if (adapter->phy_read
&& adapter->phy_read(adapter, portno,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) == 0) {
if (netxen_get_phy_int_link_status_changed(int_src)) {
if (netxen_get_phy_link(status)) {
netxen_niu_gbe_init_port(adapter,
......@@ -143,8 +137,8 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
}
}
}
if (adapter->ops->enable_phy_interrupts)
adapter->ops->enable_phy_interrupts(adapter, portno);
if (adapter->enable_phy_interrupts)
adapter->enable_phy_interrupts(adapter, portno);
}
void netxen_nic_isr_other(struct netxen_adapter *adapter)
......@@ -159,8 +153,7 @@ void netxen_nic_isr_other(struct netxen_adapter *adapter)
qg_linksup = adapter->ahw.qg_linksup;
adapter->ahw.qg_linksup = val;
DPRINTK(1, INFO, "%s: link update 0x%08x\n", netxen_nic_driver_name,
val);
DPRINTK(INFO, "link update 0x%08x\n", val);
for (portno = 0; portno < NETXEN_NIU_MAX_GBE_PORTS; portno++) {
linkup = val & 1;
if (linkup != (qg_linksup & 1)) {
......
This diff is collapsed.
/*
* Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
......@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*
* Contact Information:
* info@netxen.com
* NetXen,
......@@ -40,13 +40,15 @@
static long phy_lock_timeout = 100000000;
static inline int phy_lock(void)
static inline int phy_lock(struct netxen_adapter *adapter)
{
int i;
int done = 0, timeout = 0;
while (!done) {
done = readl((void __iomem *)NETXEN_PCIE_REG(PCIE_SEM3_LOCK));
done =
readl(pci_base_offset
(adapter, NETXEN_PCIE_REG(PCIE_SEM3_LOCK)));
if (done == 1)
break;
if (timeout >= phy_lock_timeout) {
......@@ -61,13 +63,15 @@ static inline int phy_lock(void)
}
}
writel(NETXEN_PHY_LOCK_ID, (void __iomem *)PHY_LOCK_DRIVER);
writel(PHY_LOCK_DRIVER,
NETXEN_CRB_NORMALIZE(adapter, NETXEN_PHY_LOCK_ID));
return 0;
}
static inline int phy_unlock(void)
static inline int phy_unlock(struct netxen_adapter *adapter)
{
readl((void __iomem *)NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK));
readl(pci_base_offset(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK)));
return 0;
}
......@@ -95,7 +99,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
__le32 status;
__le32 mac_cfg0;
if (phy_lock() != 0) {
if (phy_lock(adapter) != 0) {
return -1;
}
......@@ -162,7 +166,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
NETXEN_NIU_GB_MAC_CONFIG_0(0),
&mac_cfg0, 4))
return -EIO;
phy_unlock();
phy_unlock(adapter);
return result;
}
......@@ -399,8 +403,8 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
{
int result = 0;
__le32 status;
if (adapter->ops->disable_phy_interrupts)
adapter->ops->disable_phy_interrupts(adapter, port);
if (adapter->disable_phy_interrupts)
adapter->disable_phy_interrupts(adapter, port);
mdelay(2);
if (0 ==
......@@ -612,7 +616,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
__le32 temp = 0;
struct netxen_adapter *adapter = port->adapter;
int phy = port->portnum;
unsigned char mac_addr[MAX_ADDR_LEN];
unsigned char mac_addr[6];
int i;
for (i = 0; i < 10; i++) {
......@@ -631,7 +635,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
netxen_niu_macaddr_get(adapter, phy,
(netxen_ethernet_macaddr_t *) mac_addr);
if (memcmp(mac_addr, addr, MAX_ADDR_LEN == 0))
if (memcmp(mac_addr, addr, 6) == 0)
break;
}
......
This diff is collapsed.
......@@ -1335,7 +1335,7 @@ int __init init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(dev_ni52);
release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE);
......
......@@ -1259,7 +1259,7 @@ int __init init_module(void)
return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(dev_ni65);
cleanup_card(dev_ni65);
......
This diff is collapsed.
This diff is collapsed.
......@@ -750,7 +750,7 @@ int __init init_module(void)
return 0;
}
void cleanup_module(void)
void __exit cleanup_module(void)
{
unregister_netdev(dev_seeq);
release_region(dev_seeq->base_addr, SEEQ8005_IO_EXTENT);
......
......@@ -1319,7 +1319,7 @@ SK_BOOL AutoNeg) /* Is Auto-negotiation used ? */
SkXmPhyRead(pAC, IoC, Port, PHY_BCOM_INT_STAT, &Isrc);
#ifdef xDEBUG
if ((Isrc & ~(PHY_B_IS_HCT | PHY_B_IS_LCT) ==
if ((Isrc & ~(PHY_B_IS_HCT | PHY_B_IS_LCT)) ==
(PHY_B_IS_SCR_S_ER | PHY_B_IS_RRS_CHANGE | PHY_B_IS_LRS_CHANGE)) {
SK_U32 Stat1, Stat2, Stat3;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -593,7 +593,7 @@ static void cleanup_card(struct net_device *dev)
iounmap(ei_status.mem);
}
void
void __exit
cleanup_module(void)
{
int this_dev;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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