Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98239
b: refs/heads/master
c: 3276fba
h: refs/heads/master
i:
  98237: 8759b9e
  98235: 1a101a0
  98231: f1296fe
  98223: cbcf477
  98207: 8458375
  98175: 834c683
v: v3
  • Loading branch information
Dhananjay Phadke authored and Jeff Garzik committed Jun 18, 2008
1 parent 372e55e commit 336b5fc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 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: dc515f2e0b356981ea0c4581ff0e587aea8b624a
refs/heads/master: 3276fbad8385d8e86d85fad4d86dae669a045c65
2 changes: 1 addition & 1 deletion trunk/drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ struct netxen_adapter {
unsigned char mac_addr[ETH_ALEN];
int mtu;
int portnum;
u8 physical_port;

struct work_struct watchdog_task;
struct timer_list watchdog_timer;
Expand Down Expand Up @@ -1169,5 +1170,4 @@ extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,

extern struct ethtool_ops netxen_nic_ethtool_ops;

extern int physical_port[]; /* physical port # from virtual port.*/
#endif /* __NETXEN_NIC_H_ */
6 changes: 3 additions & 3 deletions trunk/drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) {
/* GB: port specific registers */
if (mode == 0 && i >= 19)
window = physical_port[adapter->portnum] *
window = adapter->physical_port *
NETXEN_NIC_PORT_WINDOW;

NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode].
Expand Down Expand Up @@ -527,7 +527,7 @@ netxen_nic_get_pauseparam(struct net_device *dev,
{
struct netxen_adapter *adapter = netdev_priv(dev);
__u32 val;
int port = physical_port[adapter->portnum];
int port = adapter->physical_port;

if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
Expand Down Expand Up @@ -573,7 +573,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
{
struct netxen_adapter *adapter = netdev_priv(dev);
__u32 val;
int port = physical_port[adapter->portnum];
int port = adapter->physical_port;
/* read mode */
if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,15 +1032,15 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu)
{
netxen_nic_write_w0(adapter,
NETXEN_NIU_GB_MAX_FRAME_SIZE(
physical_port[adapter->portnum]), new_mtu);
NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port),
new_mtu);
return 0;
}

int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
{
new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE;
if (physical_port[adapter->portnum] == 0)
if (adapter->physical_port == 0)
netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE,
new_mtu);
else
Expand All @@ -1051,7 +1051,7 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)

void netxen_nic_init_niu_gb(struct netxen_adapter *adapter)
{
netxen_niu_gbe_init_port(adapter, physical_port[adapter->portnum]);
netxen_niu_gbe_init_port(adapter, adapter->physical_port);
}

void
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/netxen/netxen_nic_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void netxen_nic_isr_other(struct netxen_adapter *adapter)

/* verify the offset */
val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE));
val = val >> physical_port[adapter->portnum];
val = val >> adapter->physical_port;
if (val == adapter->ahw.qg_linksup)
return;

Expand Down Expand Up @@ -199,7 +199,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter)

/* WINDOW = 1 */
val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE));
val >>= (physical_port[adapter->portnum] * 8);
val >>= (adapter->physical_port * 8);
val &= 0xff;

if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) {
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ static void netxen_nic_poll_controller(struct net_device *netdev);
static irqreturn_t netxen_intr(int irq, void *data);
static irqreturn_t netxen_msi_intr(int irq, void *data);

int physical_port[] = {0, 1, 2, 3};

/* PCI Device ID Table */
static struct pci_device_id netxen_pci_tbl[] __devinitdata = {
{PCI_DEVICE(0x4040, 0x0001)},
Expand Down Expand Up @@ -647,7 +645,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum)));
if (i != 0x55555555)
physical_port[adapter->portnum] = i;
adapter->physical_port = i;

netif_carrier_off(netdev);
netif_stop_queue(netdev);
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/net/netxen/netxen_nic_niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
long timeout = 0;
long result = 0;
long restore = 0;
long phy = physical_port[adapter->portnum];
long phy = adapter->physical_port;
__u32 address;
__u32 command;
__u32 status;
Expand Down Expand Up @@ -190,7 +190,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg,
long timeout = 0;
long result = 0;
long restore = 0;
long phy = physical_port[adapter->portnum];
long phy = adapter->physical_port;
__u32 address;
__u32 command;
__u32 status;
Expand Down Expand Up @@ -456,7 +456,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)

int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
{
u32 portnum = physical_port[adapter->portnum];
u32 portnum = adapter->physical_port;

netxen_crb_writelit_adapter(adapter,
NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447);
Expand Down Expand Up @@ -573,7 +573,7 @@ static int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
{
u32 stationhigh;
u32 stationlow;
int phy = physical_port[adapter->portnum];
int phy = adapter->physical_port;
u8 val[8];

if (addr == NULL)
Expand Down Expand Up @@ -604,7 +604,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
{
u8 temp[4];
u32 val;
int phy = physical_port[adapter->portnum];
int phy = adapter->physical_port;
unsigned char mac_addr[6];
int i;
DECLARE_MAC_BUF(mac);
Expand Down Expand Up @@ -724,7 +724,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
{
__u32 mac_cfg0;
u32 port = physical_port[adapter->portnum];
u32 port = adapter->physical_port;

if (port > NETXEN_NIU_MAX_GBE_PORTS)
return -EINVAL;
Expand All @@ -740,7 +740,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
{
__u32 mac_cfg;
u32 port = physical_port[adapter->portnum];
u32 port = adapter->physical_port;

if (port > NETXEN_NIU_MAX_XG_PORTS)
return -EINVAL;
Expand All @@ -757,7 +757,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode)
{
__u32 reg;
u32 port = physical_port[adapter->portnum];
u32 port = adapter->physical_port;

if (port > NETXEN_NIU_MAX_GBE_PORTS)
return -EINVAL;
Expand Down Expand Up @@ -814,7 +814,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
netxen_ethernet_macaddr_t addr)
{
int phy = physical_port[adapter->portnum];
int phy = adapter->physical_port;
u8 temp[4];
u32 val;

Expand Down Expand Up @@ -867,7 +867,7 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter,
netxen_ethernet_macaddr_t * addr)
{
int phy = physical_port[adapter->portnum];
int phy = adapter->physical_port;
u32 stationhigh;
u32 stationlow;
u8 val[8];
Expand Down Expand Up @@ -896,7 +896,7 @@ int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode)
{
__u32 reg;
u32 port = physical_port[adapter->portnum];
u32 port = adapter->physical_port;

if (port > NETXEN_NIU_MAX_XG_PORTS)
return -EINVAL;
Expand Down

0 comments on commit 336b5fc

Please sign in to comment.