Skip to content

Commit

Permalink
netxen: remove unused code
Browse files Browse the repository at this point in the history
Remove code for phy access on unreleased NX2031 based quad-gig board.

NX3031 based production quad-gig boards do not require direct phy
access by driver.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Aug 26, 2009
1 parent 9409172 commit cb7e4b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 390 deletions.
13 changes: 0 additions & 13 deletions drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,6 @@ struct netxen_adapter {
struct netxen_recv_context recv_ctx;
struct nx_host_tx_ring *tx_ring;

int (*enable_phy_interrupts) (struct netxen_adapter *);
int (*disable_phy_interrupts) (struct netxen_adapter *);
int (*macaddr_set) (struct netxen_adapter *, u8 *);
int (*set_mtu) (struct netxen_adapter *, int);
int (*set_promisc) (struct netxen_adapter *, u32);
Expand Down Expand Up @@ -1187,22 +1185,11 @@ struct netxen_adapter {
const struct firmware *fw;
};

/* Set promiscuous mode for a GbE interface */
int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, u32 mode);
int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
u32 mode);
/* 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 netxen_niu_disable_xg_port(struct netxen_adapter *adapter);

int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_gbe_disable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
__u32 * readval);
int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
Expand Down
107 changes: 0 additions & 107 deletions drivers/net/netxen/netxen_nic_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
* Bit 31: soft_reset => 1:reset the MAC and the SERDES, 0:no-op
*/

#define netxen_gb_enable_tx(config_word) \
((config_word) |= 1 << 0)
#define netxen_gb_enable_rx(config_word) \
((config_word) |= 1 << 2)
#define netxen_gb_tx_flowctl(config_word) \
((config_word) |= 1 << 4)
#define netxen_gb_rx_flowctl(config_word) \
Expand All @@ -77,8 +73,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
((config_word) |= 1 << 18)
#define netxen_gb_rx_reset_mac(config_word) \
((config_word) |= 1 << 19)
#define netxen_gb_soft_reset(config_word) \
((config_word) |= 1 << 31)

#define netxen_gb_unset_tx_flowctl(config_word) \
((config_word) &= ~(1 << 4))
Expand Down Expand Up @@ -240,7 +234,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
* Bits 14-15 : speed => 0:10Mb/s, 1:100Mb/s, 2:1000Mb/s, 3:rsvd
*/

#define netxen_get_phy_cablelen(config_word) (((config_word) >> 7) & 0x07)
#define netxen_get_phy_speed(config_word) (((config_word) >> 14) & 0x03)

#define netxen_set_phy_speed(config_word, val) \
Expand All @@ -250,84 +243,11 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
#define netxen_clear_phy_duplex(config_word) \
((config_word) &= ~(1 << 13))

#define netxen_get_phy_jabber(config_word) \
_netxen_crb_get_bit(config_word, 0)
#define netxen_get_phy_polarity(config_word) \
_netxen_crb_get_bit(config_word, 1)
#define netxen_get_phy_recvpause(config_word) \
_netxen_crb_get_bit(config_word, 2)
#define netxen_get_phy_xmitpause(config_word) \
_netxen_crb_get_bit(config_word, 3)
#define netxen_get_phy_energydetect(config_word) \
_netxen_crb_get_bit(config_word, 4)
#define netxen_get_phy_downshift(config_word) \
_netxen_crb_get_bit(config_word, 5)
#define netxen_get_phy_crossover(config_word) \
_netxen_crb_get_bit(config_word, 6)
#define netxen_get_phy_link(config_word) \
_netxen_crb_get_bit(config_word, 10)
#define netxen_get_phy_resolved(config_word) \
_netxen_crb_get_bit(config_word, 11)
#define netxen_get_phy_pagercvd(config_word) \
_netxen_crb_get_bit(config_word, 12)
#define netxen_get_phy_duplex(config_word) \
_netxen_crb_get_bit(config_word, 13)

/*
* Interrupt Register definition
* This definition applies to registers 18 and 19 (int enable and int status).
* Bit 0 : jabber
* Bit 1 : polarity_changed
* Bit 4 : energy_detect
* Bit 5 : downshift
* Bit 6 : mdi_xover_changed
* Bit 7 : fifo_over_underflow
* Bit 8 : false_carrier
* Bit 9 : symbol_error
* Bit 10: link_status_changed
* Bit 11: autoneg_completed
* Bit 12: page_received
* Bit 13: duplex_changed
* Bit 14: speed_changed
* Bit 15: autoneg_error
*/

#define netxen_get_phy_int_jabber(config_word) \
_netxen_crb_get_bit(config_word, 0)
#define netxen_get_phy_int_polarity_changed(config_word) \
_netxen_crb_get_bit(config_word, 1)
#define netxen_get_phy_int_energy_detect(config_word) \
_netxen_crb_get_bit(config_word, 4)
#define netxen_get_phy_int_downshift(config_word) \
_netxen_crb_get_bit(config_word, 5)
#define netxen_get_phy_int_mdi_xover_changed(config_word) \
_netxen_crb_get_bit(config_word, 6)
#define netxen_get_phy_int_fifo_over_underflow(config_word) \
_netxen_crb_get_bit(config_word, 7)
#define netxen_get_phy_int_false_carrier(config_word) \
_netxen_crb_get_bit(config_word, 8)
#define netxen_get_phy_int_symbol_error(config_word) \
_netxen_crb_get_bit(config_word, 9)
#define netxen_get_phy_int_link_status_changed(config_word) \
_netxen_crb_get_bit(config_word, 10)
#define netxen_get_phy_int_autoneg_completed(config_word) \
_netxen_crb_get_bit(config_word, 11)
#define netxen_get_phy_int_page_received(config_word) \
_netxen_crb_get_bit(config_word, 12)
#define netxen_get_phy_int_duplex_changed(config_word) \
_netxen_crb_get_bit(config_word, 13)
#define netxen_get_phy_int_speed_changed(config_word) \
_netxen_crb_get_bit(config_word, 14)
#define netxen_get_phy_int_autoneg_error(config_word) \
_netxen_crb_get_bit(config_word, 15)

#define netxen_set_phy_int_link_status_changed(config_word) \
((config_word) |= 1 << 10)
#define netxen_set_phy_int_autoneg_completed(config_word) \
((config_word) |= 1 << 11)
#define netxen_set_phy_int_speed_changed(config_word) \
((config_word) |= 1 << 14)

/*
* NIU Mode Register.
* Bit 0 : enable FibreChannel
Expand All @@ -342,33 +262,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
#define NETXEN_NIU_PROMISC_MODE 1
#define NETXEN_NIU_ALLMULTI_MODE 2

/*
* NIU GB Drop CRC Register
*
* Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on
* Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on
* Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on
* Bit 3 : drop_gb3 => 1:drop pkts with bad CRCs, 0:pass them on
*/

#define netxen_set_gb_drop_gb0(config_word) \
((config_word) |= 1 << 0)
#define netxen_set_gb_drop_gb1(config_word) \
((config_word) |= 1 << 1)
#define netxen_set_gb_drop_gb2(config_word) \
((config_word) |= 1 << 2)
#define netxen_set_gb_drop_gb3(config_word) \
((config_word) |= 1 << 3)

#define netxen_clear_gb_drop_gb0(config_word) \
((config_word) &= ~(1 << 0))
#define netxen_clear_gb_drop_gb1(config_word) \
((config_word) &= ~(1 << 1))
#define netxen_clear_gb_drop_gb2(config_word) \
((config_word) &= ~(1 << 2))
#define netxen_clear_gb_drop_gb3(config_word) \
((config_word) &= ~(1 << 3))

/*
* NIU XG MAC Config Register
*
Expand Down
41 changes: 11 additions & 30 deletions drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,44 +321,25 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)

void netxen_initialize_adapter_ops(struct netxen_adapter *adapter)
{
adapter->macaddr_set = netxen_p2_nic_set_mac_addr;
adapter->set_multi = netxen_p2_nic_set_multi;

switch (adapter->ahw.port_type) {
case NETXEN_NIC_GBE:
adapter->enable_phy_interrupts =
netxen_niu_gbe_enable_phy_interrupts;
adapter->disable_phy_interrupts =
netxen_niu_gbe_disable_phy_interrupts;
adapter->set_mtu = netxen_nic_set_mtu_gb;
adapter->set_promisc = netxen_niu_set_promiscuous_mode;
adapter->phy_read = netxen_niu_gbe_phy_read;
adapter->phy_write = netxen_niu_gbe_phy_write;
adapter->init_port = netxen_niu_gbe_init_port;
adapter->stop_port = netxen_niu_disable_gbe_port;
break;
adapter->init_port = netxen_niu_xg_init_port;
adapter->stop_port = netxen_niu_disable_xg_port;

case NETXEN_NIC_XGBE:
adapter->enable_phy_interrupts =
netxen_niu_xgbe_enable_phy_interrupts;
adapter->disable_phy_interrupts =
netxen_niu_xgbe_disable_phy_interrupts;
if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
adapter->macaddr_set = netxen_p2_nic_set_mac_addr;
adapter->set_multi = netxen_p2_nic_set_multi;
adapter->set_mtu = netxen_nic_set_mtu_xgb;
adapter->init_port = netxen_niu_xg_init_port;
adapter->set_promisc = netxen_niu_xg_set_promiscuous_mode;
adapter->stop_port = netxen_niu_disable_xg_port;
break;

default:
break;
}

if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
} else {
adapter->set_mtu = nx_fw_cmd_set_mtu;
adapter->set_promisc = netxen_p3_nic_set_promisc;
adapter->macaddr_set = netxen_p3_nic_set_mac_addr;
adapter->set_multi = netxen_p3_nic_set_multi;
}

if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
adapter->phy_read = netxen_niu_gbe_phy_read;
adapter->phy_write = netxen_niu_gbe_phy_write;
}
}

/*
Expand Down
Loading

0 comments on commit cb7e4b6

Please sign in to comment.