NetXen: temp monitoring, newer firmware support, mm footprint reduction
Subsystems (2)
PATCH 2/5 NetXen: temp monitoring, newer firmware support, mm footprint reduction
NetXen: 1G/10G Ethernet Driver updates
- Temparature monitoring and device control
- Memory footprint reduction
- Driver changes to support newer version of firmware
drivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +58 -31
@@ -53,6 +53,9 @@ struct netxen_nic_stats {#define NETXEN_NIC_STAT (m) sizeof(((struct netxen_port *)0)->m), \ offsetof(struct netxen_port, m) +#define NETXEN_NIC_PORT_WINDOW 0x10000 +#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF +static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { {"rcvd_bad_skb" ,NETXEN_NIC_STAT (stats.rcvdbadskb)}, {"xmit_called" ,NETXEN_NIC_STAT (stats.xmitcalled)},
@@ -111,9 +114,9 @@ netxen_nic_get_drvinfo(struct net_device {struct netxen_port *port =netdev_priv (dev);struct netxen_adapter *adapter = port->adapter; -uint32_t fw_major =0 ; -uint32_t fw_minor =0 ; -uint32_t fw_build =0 ; +u32 fw_major =0 ; +u32 fw_minor =0 ; +u32 fw_build =0 ;strncpy (drvinfo->driver,"netxen_nic" ,32 );strncpy (drvinfo->version,NETXEN_NIC_LINUX_VERSIONID ,32 );
@@ -136,6 +139,8 @@ netxen_nic_get_settings(struct net_devic {struct netxen_port *port =netdev_priv (dev);struct netxen_adapter *adapter = port->adapter; +struct netxen_board_info *boardinfo; + boardinfo = &adapter->ahw.boardcfg;/* read which mode */ if (adapter->ahw.board_type ==NETXEN_NIC_GBE ) {
@@ -144,16 +149,12 @@ netxen_nic_get_settings(struct net_devic SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | - SUPPORTED_1000baseT_Full | -SUPPORTED_TP | - SUPPORTED_MII | SUPPORTED_Autoneg); + SUPPORTED_1000baseT_Full); ecmd->advertising = (ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | ADVERTISED_1000baseT_Half | - ADVERTISED_1000baseT_Full | -ADVERTISED_TP | -ADVERTISED_MII | ADVERTISED_Autoneg); + ADVERTISED_1000baseT_Full); ecmd->port =PORT_TP ;
@@ -162,16 +163,7 @@ netxen_nic_get_settings(struct net_devic ecmd->duplex = port->link_duplex; }else return -EIO ;/* link absent */ - - ecmd->phy_address = port->portnum; - ecmd->transceiver =XCVR_EXTERNAL ; - -/* get autoneg settings */ - ecmd->autoneg = port->link_autoneg; -return 0 ; - } - -if (adapter->ahw.board_type ==NETXEN_NIC_XGBE ) { + }else if (adapter->ahw.board_type ==NETXEN_NIC_XGBE ) { ecmd->supported = (SUPPORTED_TP | SUPPORTED_1000baseT_Full | SUPPORTED_10000baseT_Full);
@@ -182,13 +174,47 @@ netxen_nic_get_settings(struct net_devic ecmd->speed =SPEED_10000 ; ecmd->duplex =DUPLEX_FULL ; - ecmd->phy_address = port->portnum; - ecmd->transceiver =XCVR_EXTERNAL ; ecmd->autoneg =AUTONEG_DISABLE ; -return 0 ; + }else +return -EIO ; + + ecmd->phy_address = port->portnum; + ecmd->transceiver =XCVR_EXTERNAL ; + +switch ((netxen_brdtype_t ) boardinfo->board_type) { +case NETXEN_BRDTYPE_P2_SB35_4G : +case NETXEN_BRDTYPE_P2_SB31_2G : + ecmd->supported |= SUPPORTED_Autoneg; + ecmd->advertising |= ADVERTISED_Autoneg; +case NETXEN_BRDTYPE_P2_SB31_10G_CX4 : + ecmd->supported |=SUPPORTED_TP ; + ecmd->advertising |=ADVERTISED_TP ; + ecmd->port =PORT_TP ; + ecmd->autoneg = (boardinfo->board_type == +NETXEN_BRDTYPE_P2_SB31_10G_CX4 ) ? + (AUTONEG_DISABLE ) : (port->link_autoneg); +break ; +case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ : +case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ : + ecmd->supported |=SUPPORTED_MII ; + ecmd->advertising |=ADVERTISED_MII ; + ecmd->port =PORT_FIBRE ; + ecmd->autoneg =AUTONEG_DISABLE ; +break ; +case NETXEN_BRDTYPE_P2_SB31_10G : + ecmd->supported |=SUPPORTED_FIBRE ; + ecmd->advertising |=ADVERTISED_FIBRE ; + ecmd->port =PORT_FIBRE ; + ecmd->autoneg =AUTONEG_DISABLE ; +break ; +default : +printk ("ERROR: Unsupported board model %d\n" , + (netxen_brdtype_t ) boardinfo->board_type); +return -EIO ; + } -return -EIO ; +return 0 ; } static int
@@ -371,7 +397,7 @@ netxen_nic_get_regs(struct net_device *dfor (i =3 ; niu_registers[mode].reg[i -3 ] !=-1 ; i++) {/* GB: port specific registers */ if (mode ==0 && i >=19 ) - window = port->portnum *0x10000 ; + window = port->portnum *NETXEN_NIC_PORT_WINDOW ; NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. reg[i - 3] + window,
@@ -385,7 +411,8 @@ static void netxen_nic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { wol->supported = WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC; - wol->wolopts =0 ;/* options can be added depending upon the mode */ +/* options can be added depending upon the mode */ + wol->wolopts =0 ; }static u32 netxen_nic_get_link (struct net_device *dev)
@@ -531,9 +558,9 @@ static int netxen_nic_reg_test(struct ne save = data_read;if (data_read) - data_written = data_read &0xDEADBEEF ; + data_written = data_read &NETXEN_NIC_INVALID_DATA ;else - data_written =0xDEADBEEF ; + data_written =NETXEN_NIC_INVALID_DATA ; netxen_nic_write_w0(adapter, NETXEN_NIU_GB_MII_MGMT_STATUS(port-> portnum),
@@ -559,9 +586,9 @@ static int netxen_nic_reg_test(struct ne save = data_read;if (data_read) - data_written = data_read &0xDEADBEEF ; + data_written = data_read &NETXEN_NIC_INVALID_DATA ;else - data_written =0xDEADBEEF ; + data_written =NETXEN_NIC_INVALID_DATA ; netxen_nic_write_w0(adapter, NETXEN_NIU_GB_MII_MGMT_INDICATE(port-> portnum),
@@ -587,9 +614,9 @@ static int netxen_nic_reg_test(struct ne save = data_read;if (data_read) - data_written = data_read &0xDEADBEEF ; + data_written = data_read &NETXEN_NIC_INVALID_DATA ;else - data_written =0xDEADBEEF ; + data_written =NETXEN_NIC_INVALID_DATA ; netxen_nic_write_w0(adapter, NETXEN_NIU_GB_INTERFACE_STATUS(port-> portnum),
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +153 -12
262 lines not on this page · raw message
drivers/net/netxen/netxen_nic_hdr.h renamed from drivers/net/netxen.one/netxen_nic_hdr.h +66 -5
117 lines not on this page · raw message
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +141 -65
431 lines not on this page · raw message
drivers/net/netxen/netxen_nic_hw.h renamed from drivers/net/netxen.one/netxen_nic_hw.h +5 -3
@@ -82,9 +82,9 @@ struct netxen_adapter;#define NETXEN_PCI_MAPSIZE_BYTES (NETXEN_PCI_MAPSIZE << 20) -#define NETXEN_NIC_LOCKED_READ_REG (X ,Y ) \ - addr = (adapter->ahw.pci_base + X); \ - *(u32 *)Y = readl((void __iomem*) addr); +#define NETXEN_NIC_LOCKED_READ_REG (X ,Y ) \ + addr = pci_base_offset(adapter, (X)); \ + *(u32 *)Y = readl(addr);struct netxen_port ;void netxen_nic_set_link_parameters (struct netxen_port *port);
@@ -472,6 +472,8 @@ int netxen_niu_xg_macaddr_set(struct net/* Generic enable for GbE ports. Will detect the speed of the link. */ int netxen_niu_gbe_init_port (struct netxen_adapter *adapter,int port); +int netxen_niu_xg_init_port (struct netxen_adapter *adapter,int port); +/* Disable a GbE interface */ int netxen_niu_disable_gbe_port (struct netxen_adapter *adapter,int port);
drivers/net/netxen/netxen_nic_init.c renamed from drivers/net/netxen.one/netxen_nic_init.c +200 -39
362 lines not on this page · raw message
drivers/net/netxen/netxen_nic_ioctl.h renamed from drivers/net/netxen.one/netxen_nic_ioctl.h +7 -5
@@ -6,12 +6,12 @@* 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,
@@ -32,9 +32,11 @@#include <linux/sockios.h> -#define NETXEN_CMD_START SIOCDEVPRIVATE -#define NETXEN_NIC_CMD (NETXEN_CMD_START + 1) -#define NETXEN_NIC_NAME (NETXEN_CMD_START + 2) +#define NETXEN_CMD_START SIOCDEVPRIVATE +#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" typedef enum { netxen_nic_cmd_none = 0,
drivers/net/netxen/netxen_nic_isr.c renamed from drivers/net/netxen.one/netxen_nic_isr.c +24 -30
71 lines not on this page · raw message
drivers/net/netxen/netxen_nic_main.c renamed from drivers/net/netxen.one/netxen_nic_main.c +82 -39
252 lines not on this page · raw message
drivers/net/netxen/netxen_nic_niu.c renamed from drivers/net/netxen.one/netxen_nic_niu.c +132 -38
264 lines not on this page · raw message
drivers/net/netxen/netxen_nic_phan_reg.h renamed from drivers/net/netxen.one/netxen_nic_phan_reg.h +22 -2
@@ -6,12 +6,12 @@* 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,
@@ -58,6 +58,9 @@#define CRB_CMD_PRODUCER_OFFSET NETXEN_NIC_REG(0x08)#define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c) +#define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10) +#define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14) +/* address of command descriptors in the host memory */ #define CRB_HOST_CMD_ADDR_HI NETXEN_NIC_REG(0x30)#define CRB_HOST_CMD_ADDR_LO NETXEN_NIC_REG(0x34)
@@ -82,10 +85,18 @@#define CRB_TX_PKT_TIMER NETXEN_NIC_REG(0x94)#define CRB_RX_PKT_CNT NETXEN_NIC_REG(0x98)#define CRB_RX_TMR_CNT NETXEN_NIC_REG(0x9c) +#define CRB_INT_THRESH NETXEN_NIC_REG(0xa4)/* Register for communicating XG link status */ #define CRB_XG_STATE NETXEN_NIC_REG(0xa0) +/* Register for communicating card temperature */ +/* Upper 16 bits are temperature value. Lower 16 bits are the state */ +#define CRB_TEMP_STATE NETXEN_NIC_REG(0xa8) +#define nx_get_temp_val (x) ((x) >> 16) +#define nx_get_temp_state (x) ((x) & 0xffff) +#define nx_encode_temp (val, state) (((val) << 16) | (state)) +/* Debug registers for controlling NIC pkt gen agent */ #define CRB_AGENT_GO NETXEN_NIC_REG(0xb0)#define CRB_AGENT_TX_SIZE NETXEN_NIC_REG(0xb4)
@@ -192,4 +203,13 @@ struct netxen_recv_crb recv_crb_registerextern struct netxen_recv_crb recv_crb_registers[];#endif /* DEFINE_GLOBAL_RECEIVE_CRB */ +/* +* Temperature control. +*/ +enum { +NX_TEMP_NORMAL =0x1 ,/* Normal operating range */ +NX_TEMP_WARN ,/* Sound alert, temperature getting high */ +NX_TEMP_PANIC /* Fatal error, hardware has shut down. */ +}; +#endif /* __NIC_PHAN_REG_H_ */
Signature · 2 lines
Don Fry [email protected]
Don Fry <[email protected]> :
Quoted 22 lines
NetXen: 1G/10G Ethernet Driver updates
- Temparature monitoring and device control
- Memory footprint reduction
- Driver changes to support newer version of firmwareSigned-off-by Amit S. Kale <[email protected]>Signed-off-by Don Fry <[email protected]>diff -Nupr
netdev-2.6/drivers/net/netxen.one/netxen_nic_ethtool.cnetdev-2.6/drivers/net/netxen/netxen_nic_ethtool.cdrivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +3
-0@@ -53,6 +53,9 @@ struct netxen_nic_stats {#define NETXEN_NIC_STAT (m) sizeof(((struct netxen_port *)0)->m), \ offsetof(struct netxen_port, m) +#define NETXEN_NIC_PORT_WINDOW 0x10000 +#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF +static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { {"rcvd_bad_skb" ,NETXEN_NIC_STAT (stats.rcvdbadskb)}, {"xmit_called" ,NETXEN_NIC_STAT (stats.xmitcalled)},
drivers/net/netxen/netxen_nic_ethtool.c netxen_nic_get_drvinfo(struct net_device · line 119
Quoted 9 lines
drivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +3
-3@@ -111,9 +114,9 @@ netxen_nic_get_drvinfo(struct net_device {struct netxen_port *port =netdev_priv (dev);struct netxen_adapter *adapter = port->adapter; -uint32_t fw_major =0 ; -uint32_t fw_minor =0 ; -uint32_t fw_build =0 ; +u32 fw_major =0 ; +u32 fw_minor =0 ; +u32 fw_build =0 ;
The description of the patch did not announce (welcome) cleanup.
There are a few ones.
[...]
drivers/net/netxen/netxen_nic_ethtool.c netxen_nic_get_settings(struct net_devic · line 143
Quoted 8 lines
drivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +2
-0strncpy (drvinfo->driver,"netxen_nic" ,32 );strncpy (drvinfo->version,NETXEN_NIC_LINUX_VERSIONID ,32 );@@ -136,6 +139,8 @@ netxen_nic_get_settings(struct net_devic {struct netxen_port *port =netdev_priv (dev);struct netxen_adapter *adapter = port->adapter; +struct netxen_board_info *boardinfo; + boardinfo = &adapter->ahw.boardcfg;
Missing separating line or merge the two lines.
[...]
Quoted 33 lines
drivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +25
-3@@ -182,13 +174,47 @@ netxen_nic_get_settings(struct net_devic ecmd->speed =SPEED_10000 ; ecmd->duplex =DUPLEX_FULL ; - ecmd->phy_address = port->portnum; - ecmd->transceiver =XCVR_EXTERNAL ; ecmd->autoneg =AUTONEG_DISABLE ; -return 0 ; + }else +return -EIO ; + + ecmd->phy_address = port->portnum; + ecmd->transceiver =XCVR_EXTERNAL ; + +switch ((netxen_brdtype_t ) boardinfo->board_type) { +case NETXEN_BRDTYPE_P2_SB35_4G : +case NETXEN_BRDTYPE_P2_SB31_2G : + ecmd->supported |= SUPPORTED_Autoneg; + ecmd->advertising |= ADVERTISED_Autoneg; +case NETXEN_BRDTYPE_P2_SB31_10G_CX4 : + ecmd->supported |=SUPPORTED_TP ; + ecmd->advertising |=ADVERTISED_TP ; + ecmd->port =PORT_TP ; + ecmd->autoneg = (boardinfo->board_type == +NETXEN_BRDTYPE_P2_SB31_10G_CX4 ) ? + (AUTONEG_DISABLE ) : (port->link_autoneg); +break ; +case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ : +case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ : + ecmd->supported |=SUPPORTED_MII ; + ecmd->advertising |=ADVERTISED_MII ; + ecmd->port =PORT_FIBRE ; + ecmd->autoneg =AUTONEG_DISABLE ;
drivers/net/netxen/netxen_nic_ethtool.c netxen_nic_get_settings(struct net_devic · line 212
Quoted 10 lines
drivers/net/netxen/netxen_nic_ethtool.c renamed from drivers/net/netxen.one/netxen_nic_ethtool.c +10
-0+break ; +case NETXEN_BRDTYPE_P2_SB31_10G : + ecmd->supported |=SUPPORTED_FIBRE ; + ecmd->advertising |=ADVERTISED_FIBRE ; + ecmd->port =PORT_FIBRE ; + ecmd->autoneg =AUTONEG_DISABLE ; +break ; +default : +printk ("ERROR: Unsupported board model %d\n" , + (netxen_brdtype_t ) boardinfo->board_type);
Missing KERN_ERR
[...]
Quoted 3 lines
diff -Nupr
netdev-2.6/drivers/net/netxen.one/netxen_nic.hnetdev-2.6/drivers/net/netxen/netxen_nic.hdrivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +0
-0
[...]
Quoted 8 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +1
-0@@ -328,6 +343,7 @@ typedef enum {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ =0x000e , NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f } netxen_brdtype_t; +#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t)) typedef enum { NETXEN_BRDMFG_INVENTEC = 1
[...]
drivers/net/netxen/netxen_nic.h static inline void netxen_nic_disable_in · line 943
Quoted 9 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +4
-1@@ -869,7 +937,10 @@ static inline void netxen_nic_disable_in/* * ISR_INT_MASK: Can be read from window 0 or 1. */ -writel (0x7ff , (void __iomem *)(adapter->ahw.pci_base +ISR_INT_MASK )); +writel (0x7ff , + (void __iomem + *)(PCI_OFFSET_SECOND_RANGE (adapter,ISR_INT_MASK ))); +
Yuck.
[...]
Quoted 17 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +7
-2@@ -888,13 +959,83 @@ static inline void netxen_nic_enable_intbreak ; } -writel (mask, (void __iomem *)(adapter->ahw.pci_base +ISR_INT_MASK )); +writel (mask, + (void __iomem + *)(PCI_OFFSET_SECOND_RANGE (adapter,ISR_INT_MASK )));if (!(adapter->flags &NETXEN_NIC_MSI_ENABLED )) { mask =0xbff ;writel (mask, (void __iomem *) - (adapter->ahw.pci_base +ISR_INT_TARGET_MASK )); + (PCI_OFFSET_SECOND_RANGE (adapter,ISR_INT_TARGET_MASK ))); + } +} +
drivers/net/netxen/netxen_nic.h static inline void netxen_nic_enable_int · line 982
Quoted 10 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +10
-0+/* +* NetXen Board information +*/ + +#define NETXEN_MAX_SHORT_NAME 16 +typedef struct { +netxen_brdtype_t brdtype;/* type of board */ +long ports;/* max no of physical ports */ +char short_name[NETXEN_MAX_SHORT_NAME ]; +}netxen_brdinfo_t ;
typedef
drivers/net/netxen/netxen_nic.h static inline void netxen_nic_enable_int · line 993
Quoted 11 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +11
-0+ +static const netxen_brdinfo_t netxen_boards[] = { + {NETXEN_BRDTYPE_P2_SB31_10G_CX4 ,1 ,"XGb CX4" }, + {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ ,1 ,"XGb HMEZ" }, + {NETXEN_BRDTYPE_P2_SB31_10G_IMEZ ,2 ,"XGb IMEZ" }, + {NETXEN_BRDTYPE_P2_SB31_10G ,1 ,"XGb XFP" }, + {NETXEN_BRDTYPE_P2_SB35_4G ,4 ,"Quad Gb" }, + {NETXEN_BRDTYPE_P2_SB31_2G ,2 ,"Dual Gb" }, +}; + +#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
Already defined. See @@ -328,6 +343,7 @@ typedef enum {
Quoted 7 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +7
-0+ +static inline void get_brd_ports_name_by_type (u32 type,int *ports,char *name) +{ +int i, found =0 ; +for (i =0 ; i <NUM_SUPPORTED_BOARDS ; ++i) { +if (netxen_boards[i].brdtype == type) { + *ports = netxen_boards[i].ports;
drivers/net/netxen/netxen_nic.h static inline void netxen_nic_enable_int · line 1010
Quoted 10 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +10
-0+strcpy (name, netxen_boards[i].short_name); + found =1 ; +break ; + } + } +if (!found) { + *ports =0 ; + name ="Unknown" ; + } +}
- 'i' and 'found' carry the same information.
- this function does not seem to be used anywhere.
- avoid inline
[...]
Quoted 3 lines
diff -Nupr
netdev-2.6/drivers/net/netxen.one/netxen_nic_hw.cnetdev-2.6/drivers/net/netxen/netxen_nic_hw.cdrivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +0
-0
[...]
Quoted 22 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +6
-8@@ -214,25 +225,34 @@ int netxen_nic_hw_resources(struct netxe }DPRINTK (INFO ,"Recieve Peg ready too. starting stuff\n" ); - addr =pci_alloc_consistent (adapter->ahw.pdev, -sizeof (struct cmd_desc_type0 ) * - adapter->max_tx_desc_count, - &hw->cmd_desc_phys_addr); + addr =netxen_alloc (adapter->ahw.pdev, +sizeof (struct cmd_desc_type0 ) * + adapter->max_tx_desc_count, + &hw->cmd_desc_phys_addr, &hw->cmd_desc_pdev); +if (addr ==NULL ) {DPRINTK (ERR ,"bad return from pci_alloc_consistent\n" ); - err = -ENOMEM ; -return err; +return -ENOMEM ; } -/* we need to prelink all of the cmd descriptors */ - pcmd = (struct cmd_desc_type0 *)addr;
drivers/net/netxen/netxen_nic_hw.c int netxen_nic_hw_resources(struct netxe · line 243
Quoted 10 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +6
-4-for (i =1 ; i < adapter->max_tx_desc_count; i++) { - pcmd->netxen_next = - (card_cmdring + i *sizeof (struct cmd_desc_type0 )); - pcmd++; + pause_addr =netxen_alloc (adapter->ahw.pdev,512 , + (dma_addr_t *) & hw->pause_physaddr, + &hw->pause_pdev); +if (pause_addr ==NULL ) { +DPRINTK (1 ,ERR ,"bad return from pci_alloc_consistent\n" ); +return -ENOMEM ;
"addr" leak (whatever is done outside of the function, hw->cmd_desc_phys_addr is set but hw->cmd_desc_head is not).
drivers/net/netxen/netxen_nic_hw.c int netxen_nic_hw_resources(struct netxe · line 246
Quoted 3 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +3
-0+ } + + hw->pauseaddr = (char *)pause_addr;
Cast from void *
[...]
drivers/net/netxen/netxen_nic_hw.c int netxen_nic_hw_resources(struct netxe · line 282
Quoted 13 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +5
-4@@ -254,10 +275,11 @@ int netxen_nic_hw_resources(struct netxe rcv_desc->desc_head = (struct rcv_desc *)addr; } - addr =pci_alloc_consistent (adapter->ahw.pdev, -STATUS_DESC_RINGSIZE , - &recv_ctx-> - rcv_status_desc_phys_addr); + addr =netxen_alloc (adapter->ahw.pdev, +STATUS_DESC_RINGSIZE , + &recv_ctx-> + rcv_status_desc_phys_addr, + &recv_ctx->rcv_status_desc_pdev);
Yuck
[...]
Quoted 10 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +1
-1@@ -629,7 +675,7 @@ void netxen_nic_write_w0(struct netxen_avoid __iomem *addr;netxen_nic_pci_change_crbwindow (adapter,0 ); - addr = (void __iomem *)(adapter->ahw.pci_base + index); + addr = (void __iomem *)(pci_base_offset (adapter, index));writel (value, addr);netxen_nic_pci_change_crbwindow (adapter,1 ); }
drivers/net/netxen/netxen_nic_hw.c void netxen_nic_read_w0(struct netxen_ad · line 688
Quoted 5 lines
drivers/net/netxen/netxen_nic_hw.c renamed from drivers/net/netxen.one/netxen_nic_hw.c +1
-1@@ -639,7 +685,7 @@ void netxen_nic_read_w0(struct netxen_ad {void __iomem *addr; - addr = (void __iomem *)(adapter->ahw.pci_base + index); + addr = (void __iomem *)(pci_base_offset (adapter, index));
Useless cast: pci_base_offset() returns (void __iomem *).
Signature · 1 line
Ueimor
Quoted 12 lines
drivers/net/netxen/netxen_nic.h static inline void netxen_nic_disable_in · line 943
Quoted 10 lines
drivers/net/netxen/netxen_nic.h renamed from drivers/net/netxen.one/netxen_nic.h +4
-1@@ -869,7 +937,10 @@ static inline void netxen_nic_disable_in/* * ISR_INT_MASK: Can be read from window 0 or 1. */ -writel (0x7ff , (void __iomem *)(adapter->ahw.pci_base +ISR_INT_MASK )); +writel (0x7ff , + (void __iomem + *)(PCI_OFFSET_SECOND_RANGE (adapter,ISR_INT_MASK ))); +Yuck
If pci_base were correctly typed __iomem the casting would not be needed.