[netdevice] Remove netdev_priv() helper function

Some network device drivers use the trivial netdev_priv() helper
function while others use the netdev->priv pointer directly.

Standardise on direct use of netdev->priv, in order to free up the
function name netdev_priv() for reuse.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/1052/head
Michael Brown 2023-09-13 14:30:25 +01:00
parent 0aa2e4ec96
commit eeb7cd56e5
23 changed files with 182 additions and 193 deletions

View File

@ -272,7 +272,7 @@ static int a3c90x_setup_tx_ring(struct INF_3C90X *p)
*/ */
static void a3c90x_process_tx_packets(struct net_device *netdev) static void a3c90x_process_tx_packets(struct net_device *netdev)
{ {
struct INF_3C90X *p = netdev_priv(netdev); struct INF_3C90X *p = netdev->priv;
unsigned int downlist_ptr; unsigned int downlist_ptr;
DBGP("a3c90x_process_tx_packets\n"); DBGP("a3c90x_process_tx_packets\n");
@ -320,7 +320,7 @@ static void a3c90x_free_tx_ring(struct INF_3C90X *p)
static int a3c90x_transmit(struct net_device *netdev, static int a3c90x_transmit(struct net_device *netdev,
struct io_buffer *iob) struct io_buffer *iob)
{ {
struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct INF_3C90X *inf_3c90x = netdev->priv;
struct TXD *tx_cur_desc; struct TXD *tx_cur_desc;
struct TXD *tx_prev_desc; struct TXD *tx_prev_desc;
@ -518,7 +518,7 @@ static void a3c90x_process_rx_packets(struct net_device *netdev)
{ {
int i; int i;
unsigned int rx_status; unsigned int rx_status;
struct INF_3C90X *p = netdev_priv(netdev); struct INF_3C90X *p = netdev->priv;
struct RXD *rx_cur_desc; struct RXD *rx_cur_desc;
DBGP("a3c90x_process_rx_packets\n"); DBGP("a3c90x_process_rx_packets\n");
@ -567,7 +567,7 @@ static void a3c90x_process_rx_packets(struct net_device *netdev)
*/ */
static void a3c90x_poll(struct net_device *netdev) static void a3c90x_poll(struct net_device *netdev)
{ {
struct INF_3C90X *p = netdev_priv(netdev); struct INF_3C90X *p = netdev->priv;
uint16_t raw_status, int_status; uint16_t raw_status, int_status;
DBGP("a3c90x_poll\n"); DBGP("a3c90x_poll\n");
@ -611,7 +611,7 @@ static void a3c90x_free_resources(struct INF_3C90X *p)
static void a3c90x_remove(struct pci_device *pci) static void a3c90x_remove(struct pci_device *pci)
{ {
struct net_device *netdev = pci_get_drvdata(pci); struct net_device *netdev = pci_get_drvdata(pci);
struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct INF_3C90X *inf_3c90x = netdev->priv;
DBGP("a3c90x_remove\n"); DBGP("a3c90x_remove\n");
@ -628,7 +628,7 @@ static void a3c90x_remove(struct pci_device *pci)
static void a3c90x_irq(struct net_device *netdev, int enable) static void a3c90x_irq(struct net_device *netdev, int enable)
{ {
struct INF_3C90X *p = netdev_priv(netdev); struct INF_3C90X *p = netdev->priv;
DBGP("a3c90x_irq\n"); DBGP("a3c90x_irq\n");
@ -657,7 +657,7 @@ static void a3c90x_hw_start(struct net_device *netdev)
unsigned int cfg; unsigned int cfg;
unsigned int mopt; unsigned int mopt;
unsigned short linktype; unsigned short linktype;
struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct INF_3C90X *inf_3c90x = netdev->priv;
DBGP("a3c90x_hw_start\n"); DBGP("a3c90x_hw_start\n");
@ -796,7 +796,7 @@ static void a3c90x_hw_start(struct net_device *netdev)
static int a3c90x_open(struct net_device *netdev) static int a3c90x_open(struct net_device *netdev)
{ {
int rc; int rc;
struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct INF_3C90X *inf_3c90x = netdev->priv;
DBGP("a3c90x_open\n"); DBGP("a3c90x_open\n");
@ -845,7 +845,7 @@ static int a3c90x_open(struct net_device *netdev)
*/ */
static void a3c90x_close(struct net_device *netdev) static void a3c90x_close(struct net_device *netdev)
{ {
struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct INF_3C90X *inf_3c90x = netdev->priv;
DBGP("a3c90x_close\n"); DBGP("a3c90x_close\n");
@ -895,7 +895,7 @@ static int a3c90x_probe(struct pci_device *pci)
pci_set_drvdata(pci, netdev); pci_set_drvdata(pci, netdev);
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
inf_3c90x = netdev_priv(netdev); inf_3c90x = netdev->priv;
memset(inf_3c90x, 0, sizeof(*inf_3c90x)); memset(inf_3c90x, 0, sizeof(*inf_3c90x));
adjust_pci_device(pci); adjust_pci_device(pci);

View File

@ -173,7 +173,7 @@ static int atl1e_check_link(struct atl1e_adapter *adapter)
static int atl1e_mdio_read(struct net_device *netdev, int phy_id __unused, static int atl1e_mdio_read(struct net_device *netdev, int phy_id __unused,
int reg_num) int reg_num)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
u16 result; u16 result;
atl1e_read_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, &result); atl1e_read_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, &result);
@ -183,7 +183,7 @@ static int atl1e_mdio_read(struct net_device *netdev, int phy_id __unused,
static void atl1e_mdio_write(struct net_device *netdev, int phy_id __unused, static void atl1e_mdio_write(struct net_device *netdev, int phy_id __unused,
int reg_num, int val) int reg_num, int val)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
atl1e_write_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, val); atl1e_write_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, val);
} }
@ -841,7 +841,7 @@ fatal_err:
*/ */
static void atl1e_poll(struct net_device *netdev) static void atl1e_poll(struct net_device *netdev)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
struct atl1e_hw *hw = &adapter->hw; struct atl1e_hw *hw = &adapter->hw;
int max_ints = 64; int max_ints = 64;
u32 status; u32 status;
@ -963,7 +963,7 @@ static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count __unused,
static int atl1e_xmit_frame(struct net_device *netdev, struct io_buffer *iob) static int atl1e_xmit_frame(struct net_device *netdev, struct io_buffer *iob)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
u16 tpd_req = 1; u16 tpd_req = 1;
struct atl1e_tpd_desc *tpd; struct atl1e_tpd_desc *tpd;
@ -1013,7 +1013,7 @@ int atl1e_up(struct atl1e_adapter *adapter)
void atl1e_irq(struct net_device *netdev, int enable) void atl1e_irq(struct net_device *netdev, int enable)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
if (enable) if (enable)
atl1e_irq_enable(adapter); atl1e_irq_enable(adapter);
@ -1051,7 +1051,7 @@ void atl1e_down(struct atl1e_adapter *adapter)
*/ */
static int atl1e_open(struct net_device *netdev) static int atl1e_open(struct net_device *netdev)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
int err; int err;
/* allocate rx/tx dma buffer & descriptors */ /* allocate rx/tx dma buffer & descriptors */
@ -1086,7 +1086,7 @@ err_up:
*/ */
static void atl1e_close(struct net_device *netdev) static void atl1e_close(struct net_device *netdev)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
atl1e_down(adapter); atl1e_down(adapter);
atl1e_free_ring_resources(adapter); atl1e_free_ring_resources(adapter);
@ -1138,7 +1138,7 @@ static int atl1e_probe(struct pci_device *pdev)
atl1e_init_netdev(netdev, pdev); atl1e_init_netdev(netdev, pdev);
adapter = netdev_priv(netdev); adapter = netdev->priv;
adapter->bd_number = cards_found; adapter->bd_number = cards_found;
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
@ -1227,7 +1227,7 @@ err:
static void atl1e_remove(struct pci_device *pdev) static void atl1e_remove(struct pci_device *pdev)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev->priv;
unregister_netdev(netdev); unregister_netdev(netdev);
atl1e_free_ring_resources(adapter); atl1e_free_ring_resources(adapter);

View File

@ -622,7 +622,7 @@ static void b44_load_mac_and_phy_addr(struct b44_private *bp)
static void b44_set_rx_mode(struct net_device *netdev) static void b44_set_rx_mode(struct net_device *netdev)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
unsigned char zero[6] = { 0, 0, 0, 0, 0, 0 }; unsigned char zero[6] = { 0, 0, 0, 0, 0, 0 };
u32 val; u32 val;
int i; int i;
@ -667,7 +667,7 @@ static int b44_probe(struct pci_device *pci)
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
/* Set up private data */ /* Set up private data */
bp = netdev_priv(netdev); bp = netdev->priv;
memset(bp, 0, sizeof(*bp)); memset(bp, 0, sizeof(*bp));
bp->netdev = netdev; bp->netdev = netdev;
bp->pci = pci; bp->pci = pci;
@ -712,7 +712,7 @@ static int b44_probe(struct pci_device *pci)
static void b44_remove(struct pci_device *pci) static void b44_remove(struct pci_device *pci)
{ {
struct net_device *netdev = pci_get_drvdata(pci); struct net_device *netdev = pci_get_drvdata(pci);
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
ssb_core_disable(bp); ssb_core_disable(bp);
unregister_netdev(netdev); unregister_netdev(netdev);
@ -729,7 +729,7 @@ static void b44_remove(struct pci_device *pci)
*/ */
static void b44_irq(struct net_device *netdev, int enable) static void b44_irq(struct net_device *netdev, int enable)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
/* Interrupt mask specifies which events generate interrupts */ /* Interrupt mask specifies which events generate interrupts */
bw32(bp, B44_IMASK, enable ? IMASK_DEF : IMASK_DISABLE); bw32(bp, B44_IMASK, enable ? IMASK_DEF : IMASK_DISABLE);
@ -743,7 +743,7 @@ static void b44_irq(struct net_device *netdev, int enable)
*/ */
static int b44_open(struct net_device *netdev) static int b44_open(struct net_device *netdev)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
int rc; int rc;
rc = b44_init_tx_ring(bp); rc = b44_init_tx_ring(bp);
@ -769,7 +769,7 @@ static int b44_open(struct net_device *netdev)
*/ */
static void b44_close(struct net_device *netdev) static void b44_close(struct net_device *netdev)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
b44_chip_reset(bp, B44_FULL_RESET); b44_chip_reset(bp, B44_FULL_RESET);
b44_free_tx_ring(bp); b44_free_tx_ring(bp);
@ -785,7 +785,7 @@ static void b44_close(struct net_device *netdev)
*/ */
static int b44_transmit(struct net_device *netdev, struct io_buffer *iobuf) static int b44_transmit(struct net_device *netdev, struct io_buffer *iobuf)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
u32 cur = bp->tx_cur; u32 cur = bp->tx_cur;
u32 ctrl; u32 ctrl;
@ -905,7 +905,7 @@ static void b44_process_rx_packets(struct b44_private *bp)
*/ */
static void b44_poll(struct net_device *netdev) static void b44_poll(struct net_device *netdev)
{ {
struct b44_private *bp = netdev_priv(netdev); struct b44_private *bp = netdev->priv;
u32 istat; u32 istat;
/* Interrupt status */ /* Interrupt status */

View File

@ -307,7 +307,7 @@ void bnxt_set_txq ( struct bnxt *bp, int entry, dma_addr_t mapping, int len )
static void bnxt_tx_complete ( struct net_device *dev, u16 hw_idx ) static void bnxt_tx_complete ( struct net_device *dev, u16 hw_idx )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
struct io_buffer *iob; struct io_buffer *iob;
iob = bp->tx.iob[hw_idx]; iob = bp->tx.iob[hw_idx];
@ -484,7 +484,7 @@ void bnxt_rx_process ( struct net_device *dev, struct bnxt *bp,
static int bnxt_rx_complete ( struct net_device *dev, static int bnxt_rx_complete ( struct net_device *dev,
struct rx_pkt_cmpl *rx_cmp ) struct rx_pkt_cmpl *rx_cmp )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
struct rx_pkt_cmpl_hi *rx_cmp_hi; struct rx_pkt_cmpl_hi *rx_cmp_hi;
u8 cmpl_bit = bp->cq.completion_bit; u8 cmpl_bit = bp->cq.completion_bit;
@ -1927,7 +1927,7 @@ int bnxt_hwrm_run ( hwrm_func_t cmds[], struct bnxt *bp )
static int bnxt_open ( struct net_device *dev ) static int bnxt_open ( struct net_device *dev )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
DBGP ( "%s\n", __func__ ); DBGP ( "%s\n", __func__ );
bnxt_mm_nic ( bp ); bnxt_mm_nic ( bp );
@ -1952,7 +1952,7 @@ static void bnxt_tx_adjust_pkt ( struct bnxt *bp, struct io_buffer *iob )
static int bnxt_tx ( struct net_device *dev, struct io_buffer *iob ) static int bnxt_tx ( struct net_device *dev, struct io_buffer *iob )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
u16 len, entry; u16 len, entry;
dma_addr_t mapping; dma_addr_t mapping;
@ -2009,7 +2009,7 @@ void bnxt_link_evt ( struct bnxt *bp, struct hwrm_async_event_cmpl *evt )
static void bnxt_service_cq ( struct net_device *dev ) static void bnxt_service_cq ( struct net_device *dev )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
struct cmpl_base *cmp; struct cmpl_base *cmp;
struct tx_cmpl *tx; struct tx_cmpl *tx;
u16 old_cid = bp->cq.cons_id; u16 old_cid = bp->cq.cons_id;
@ -2057,7 +2057,7 @@ static void bnxt_service_cq ( struct net_device *dev )
static void bnxt_service_nq ( struct net_device *dev ) static void bnxt_service_nq ( struct net_device *dev )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
struct nq_base *nqp; struct nq_base *nqp;
u16 old_cid = bp->nq.cons_id; u16 old_cid = bp->nq.cons_id;
int done = SERVICE_NEXT_NQ_BD; int done = SERVICE_NEXT_NQ_BD;
@ -2102,7 +2102,7 @@ static void bnxt_poll ( struct net_device *dev )
static void bnxt_close ( struct net_device *dev ) static void bnxt_close ( struct net_device *dev )
{ {
struct bnxt *bp = netdev_priv ( dev ); struct bnxt *bp = dev->priv;
DBGP ( "%s\n", __func__ ); DBGP ( "%s\n", __func__ );
bnxt_down_nic (bp); bnxt_down_nic (bp);
@ -2143,7 +2143,7 @@ static int bnxt_init_one ( struct pci_device *pci )
netdev_init ( netdev, &bnxt_netdev_ops ); netdev_init ( netdev, &bnxt_netdev_ops );
/* Driver private area for this device */ /* Driver private area for this device */
bp = netdev_priv ( netdev ); bp = netdev->priv;
/* Set PCI driver private data */ /* Set PCI driver private data */
pci_set_drvdata ( pci, netdev ); pci_set_drvdata ( pci, netdev );
@ -2197,7 +2197,7 @@ disable_pdev:
static void bnxt_remove_one ( struct pci_device *pci ) static void bnxt_remove_one ( struct pci_device *pci )
{ {
struct net_device *netdev = pci_get_drvdata ( pci ); struct net_device *netdev = pci_get_drvdata ( pci );
struct bnxt *bp = netdev_priv ( netdev ); struct bnxt *bp = netdev->priv;
DBGP ( "%s\n", __func__ ); DBGP ( "%s\n", __func__ );
/* Unregister network device */ /* Unregister network device */

View File

@ -690,7 +690,7 @@ static void ifec_reset ( struct net_device *netdev )
*/ */
static void ifec_free ( struct net_device *netdev ) static void ifec_free ( struct net_device *netdev )
{ {
struct ifec_private *priv = netdev_priv ( netdev ); struct ifec_private *priv = netdev->priv;
int i; int i;
DBGP ( "ifec_free\n" ); DBGP ( "ifec_free\n" );

View File

@ -97,7 +97,7 @@ static const char * snpnet_mac_text ( EFI_MAC_ADDRESS *mac, size_t len ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void snpnet_dump_mode ( struct net_device *netdev ) { static void snpnet_dump_mode ( struct net_device *netdev ) {
struct snp_nic *snp = netdev_priv ( netdev ); struct snp_nic *snp = netdev->priv;
EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode; EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode;
size_t mac_len = mode->HwAddressSize; size_t mac_len = mode->HwAddressSize;
unsigned int i; unsigned int i;
@ -136,7 +136,7 @@ static void snpnet_dump_mode ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void snpnet_check_link ( struct net_device *netdev ) { static void snpnet_check_link ( struct net_device *netdev ) {
struct snp_nic *snp = netdev_priv ( netdev ); struct snp_nic *snp = netdev->priv;
EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode; EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode;
/* Do nothing unless media presence detection is supported */ /* Do nothing unless media presence detection is supported */
@ -160,7 +160,7 @@ static void snpnet_check_link ( struct net_device *netdev ) {
*/ */
static int snpnet_transmit ( struct net_device *netdev, static int snpnet_transmit ( struct net_device *netdev,
struct io_buffer *iobuf ) { struct io_buffer *iobuf ) {
struct snp_nic *snp = netdev_priv ( netdev ); struct snp_nic *snp = netdev->priv;
EFI_STATUS efirc; EFI_STATUS efirc;
int rc; int rc;

View File

@ -3725,7 +3725,7 @@ efab_receive ( struct efab_nic *efab, unsigned int id, int len, int drop )
static int static int
efab_transmit ( struct net_device *netdev, struct io_buffer *iob ) efab_transmit ( struct net_device *netdev, struct io_buffer *iob )
{ {
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
struct efab_tx_queue *tx_queue = &efab->tx_queue; struct efab_tx_queue *tx_queue = &efab->tx_queue;
int fill_level, space; int fill_level, space;
falcon_tx_desc_t *txd; falcon_tx_desc_t *txd;
@ -3844,7 +3844,7 @@ falcon_handle_event ( struct efab_nic *efab, falcon_event_t *evt )
static void static void
efab_poll ( struct net_device *netdev ) efab_poll ( struct net_device *netdev )
{ {
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
struct efab_ev_queue *ev_queue = &efab->ev_queue; struct efab_ev_queue *ev_queue = &efab->ev_queue;
struct efab_rx_queue *rx_queue = &efab->rx_queue; struct efab_rx_queue *rx_queue = &efab->rx_queue;
falcon_event_t *evt; falcon_event_t *evt;
@ -3883,7 +3883,7 @@ efab_poll ( struct net_device *netdev )
static void static void
efab_irq ( struct net_device *netdev, int enable ) efab_irq ( struct net_device *netdev, int enable )
{ {
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
struct efab_ev_queue *ev_queue = &efab->ev_queue; struct efab_ev_queue *ev_queue = &efab->ev_queue;
switch ( enable ) { switch ( enable ) {
@ -4032,7 +4032,7 @@ efab_init_mac ( struct efab_nic *efab )
static void static void
efab_close ( struct net_device *netdev ) efab_close ( struct net_device *netdev )
{ {
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
falcon_fini_resources ( efab ); falcon_fini_resources ( efab );
efab_free_resources ( efab ); efab_free_resources ( efab );
@ -4043,7 +4043,7 @@ efab_close ( struct net_device *netdev )
static int static int
efab_open ( struct net_device *netdev ) efab_open ( struct net_device *netdev )
{ {
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
struct efab_rx_queue *rx_queue = &efab->rx_queue; struct efab_rx_queue *rx_queue = &efab->rx_queue;
int rc; int rc;
@ -4104,7 +4104,7 @@ static void
efab_remove ( struct pci_device *pci ) efab_remove ( struct pci_device *pci )
{ {
struct net_device *netdev = pci_get_drvdata ( pci ); struct net_device *netdev = pci_get_drvdata ( pci );
struct efab_nic *efab = netdev_priv ( netdev ); struct efab_nic *efab = netdev->priv;
if ( efab->membase ) { if ( efab->membase ) {
falcon_reset ( efab ); falcon_reset ( efab );
@ -4143,7 +4143,7 @@ efab_probe ( struct pci_device *pci )
pci_set_drvdata ( pci, netdev ); pci_set_drvdata ( pci, netdev );
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
efab = netdev_priv ( netdev ); efab = netdev->priv;
memset ( efab, 0, sizeof ( *efab ) ); memset ( efab, 0, sizeof ( *efab ) );
efab->netdev = netdev; efab->netdev = netdev;

View File

@ -677,7 +677,7 @@ set_speed:
static int static int
forcedeth_open ( struct net_device *netdev ) forcedeth_open ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
void *ioaddr = priv->mmio_addr; void *ioaddr = priv->mmio_addr;
int i; int i;
int rc; int rc;
@ -794,7 +794,7 @@ err_init_rings:
static int static int
forcedeth_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) forcedeth_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
void *ioaddr = priv->mmio_addr; void *ioaddr = priv->mmio_addr;
struct ring_desc *tx_curr_desc; struct ring_desc *tx_curr_desc;
u32 size = iob_len ( iobuf ); u32 size = iob_len ( iobuf );
@ -853,7 +853,7 @@ forcedeth_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
static void static void
nv_process_tx_packets ( struct net_device *netdev ) nv_process_tx_packets ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
struct ring_desc *tx_curr_desc; struct ring_desc *tx_curr_desc;
u32 flaglen; u32 flaglen;
@ -899,7 +899,7 @@ nv_process_tx_packets ( struct net_device *netdev )
static void static void
nv_process_rx_packets ( struct net_device *netdev ) nv_process_rx_packets ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
struct io_buffer *curr_iob; struct io_buffer *curr_iob;
struct ring_desc *rx_curr_desc; struct ring_desc *rx_curr_desc;
u32 flags, len; u32 flags, len;
@ -960,7 +960,7 @@ nv_process_rx_packets ( struct net_device *netdev )
static void static void
forcedeth_link_status ( struct net_device *netdev ) forcedeth_link_status ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
void *ioaddr = priv->mmio_addr; void *ioaddr = priv->mmio_addr;
/* Clear the MII link change status by reading the MIIStatus register */ /* Clear the MII link change status by reading the MIIStatus register */
@ -981,7 +981,7 @@ forcedeth_link_status ( struct net_device *netdev )
static void static void
forcedeth_poll ( struct net_device *netdev ) forcedeth_poll ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
void *ioaddr = priv->mmio_addr; void *ioaddr = priv->mmio_addr;
u32 status; u32 status;
@ -1018,7 +1018,7 @@ forcedeth_poll ( struct net_device *netdev )
static void static void
forcedeth_close ( struct net_device *netdev ) forcedeth_close ( struct net_device *netdev )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
DBGP ( "forcedeth_close\n" ); DBGP ( "forcedeth_close\n" );
@ -1045,7 +1045,7 @@ forcedeth_close ( struct net_device *netdev )
static void static void
forcedeth_irq ( struct net_device *netdev, int action ) forcedeth_irq ( struct net_device *netdev, int action )
{ {
struct forcedeth_private *priv = netdev_priv ( netdev ); struct forcedeth_private *priv = netdev->priv;
DBGP ( "forcedeth_irq\n" ); DBGP ( "forcedeth_irq\n" );
@ -1814,7 +1814,7 @@ forcedeth_probe ( struct pci_device *pdev )
netdev->dev = &pdev->dev; netdev->dev = &pdev->dev;
/* Get a reference to our private data */ /* Get a reference to our private data */
priv = netdev_priv ( netdev ); priv = netdev->priv;
/* We'll need these set up for the rest of the routines */ /* We'll need these set up for the rest of the routines */
priv->pci_dev = pdev; priv->pci_dev = pdev;

View File

@ -179,7 +179,7 @@ static void igbvf_irq_enable ( struct igbvf_adapter *adapter )
**/ **/
static void igbvf_irq ( struct net_device *netdev, int enable ) static void igbvf_irq ( struct net_device *netdev, int enable )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
DBG ( "igbvf_irq\n" ); DBG ( "igbvf_irq\n" );
@ -197,7 +197,7 @@ static void igbvf_irq ( struct net_device *netdev, int enable )
**/ **/
static void igbvf_process_tx_packets ( struct net_device *netdev ) static void igbvf_process_tx_packets ( struct net_device *netdev )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
uint32_t i; uint32_t i;
uint32_t tx_status; uint32_t tx_status;
union e1000_adv_tx_desc *tx_curr_desc; union e1000_adv_tx_desc *tx_curr_desc;
@ -243,7 +243,7 @@ static void igbvf_process_tx_packets ( struct net_device *netdev )
**/ **/
static void igbvf_process_rx_packets ( struct net_device *netdev ) static void igbvf_process_rx_packets ( struct net_device *netdev )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint32_t i; uint32_t i;
uint32_t rx_status; uint32_t rx_status;
@ -306,7 +306,7 @@ static void igbvf_process_rx_packets ( struct net_device *netdev )
*/ */
static void igbvf_poll ( struct net_device *netdev ) static void igbvf_poll ( struct net_device *netdev )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
uint32_t rx_status; uint32_t rx_status;
union e1000_adv_rx_desc *rx_curr_desc; union e1000_adv_rx_desc *rx_curr_desc;
@ -612,7 +612,7 @@ int igbvf_setup_rx_resources ( struct igbvf_adapter *adapter )
**/ **/
static int igbvf_open ( struct net_device *netdev ) static int igbvf_open ( struct net_device *netdev )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
int err; int err;
DBG ("igbvf_open\n"); DBG ("igbvf_open\n");
@ -667,7 +667,7 @@ err_setup_tx:
**/ **/
static void igbvf_close ( struct net_device *netdev ) static void igbvf_close ( struct net_device *netdev )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint32_t rxdctl; uint32_t rxdctl;
@ -698,7 +698,7 @@ static void igbvf_close ( struct net_device *netdev )
*/ */
static int igbvf_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) static int igbvf_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
{ {
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint32_t tx_curr = adapter->tx_tail; uint32_t tx_curr = adapter->tx_tail;
union e1000_adv_tx_desc *tx_curr_desc; union e1000_adv_tx_desc *tx_curr_desc;
@ -810,7 +810,7 @@ int igbvf_probe ( struct pci_device *pdev )
netdev->dev = &pdev->dev; netdev->dev = &pdev->dev;
/* Initialize driver private storage */ /* Initialize driver private storage */
adapter = netdev_priv ( netdev ); adapter = netdev->priv;
memset ( adapter, 0, ( sizeof ( *adapter ) ) ); memset ( adapter, 0, ( sizeof ( *adapter ) ) );
adapter->pdev = pdev; adapter->pdev = pdev;
@ -924,7 +924,7 @@ err_alloc_etherdev:
void igbvf_remove ( struct pci_device *pdev ) void igbvf_remove ( struct pci_device *pdev )
{ {
struct net_device *netdev = pci_get_drvdata ( pdev ); struct net_device *netdev = pci_get_drvdata ( pdev );
struct igbvf_adapter *adapter = netdev_priv ( netdev ); struct igbvf_adapter *adapter = netdev->priv;
DBG ( "igbvf_remove\n" ); DBG ( "igbvf_remove\n" );

View File

@ -1153,7 +1153,7 @@ jme_reload_eeprom(struct jme_adapter *jme)
static void static void
jme_load_macaddr(struct net_device *netdev) jme_load_macaddr(struct net_device *netdev)
{ {
struct jme_adapter *jme = netdev_priv(netdev); struct jme_adapter *jme = netdev->priv;
unsigned char macaddr[6]; unsigned char macaddr[6];
u32 val; u32 val;

View File

@ -690,7 +690,7 @@ pcnet32_hw_start ( struct pcnet32_private *priv )
static int static int
pcnet32_open ( struct net_device *netdev ) pcnet32_open ( struct net_device *netdev )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
unsigned long ioaddr = priv->pci_dev->ioaddr; unsigned long ioaddr = priv->pci_dev->ioaddr;
int rc; int rc;
u16 val; u16 val;
@ -754,7 +754,7 @@ err_setup_tx:
static int static int
pcnet32_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) pcnet32_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
unsigned long ioaddr = priv->pci_dev->ioaddr; unsigned long ioaddr = priv->pci_dev->ioaddr;
uint32_t tx_len = iob_len ( iobuf ); uint32_t tx_len = iob_len ( iobuf );
struct pcnet32_tx_desc *tx_curr_desc; struct pcnet32_tx_desc *tx_curr_desc;
@ -802,7 +802,7 @@ pcnet32_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
static void static void
pcnet32_process_tx_packets ( struct net_device *netdev ) pcnet32_process_tx_packets ( struct net_device *netdev )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
struct pcnet32_tx_desc *tx_curr_desc; struct pcnet32_tx_desc *tx_curr_desc;
DBGP ( "pcnet32_process_tx_packets\n" ); DBGP ( "pcnet32_process_tx_packets\n" );
@ -848,7 +848,7 @@ pcnet32_process_tx_packets ( struct net_device *netdev )
static void static void
pcnet32_process_rx_packets ( struct net_device *netdev ) pcnet32_process_rx_packets ( struct net_device *netdev )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
struct pcnet32_rx_desc *rx_curr_desc; struct pcnet32_rx_desc *rx_curr_desc;
u16 status; u16 status;
u32 len; u32 len;
@ -913,7 +913,7 @@ pcnet32_process_rx_packets ( struct net_device *netdev )
static void static void
pcnet32_poll ( struct net_device *netdev ) pcnet32_poll ( struct net_device *netdev )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
unsigned long ioaddr = priv->pci_dev->ioaddr; unsigned long ioaddr = priv->pci_dev->ioaddr;
u16 status; u16 status;
@ -946,7 +946,7 @@ pcnet32_poll ( struct net_device *netdev )
static void static void
pcnet32_close ( struct net_device *netdev ) pcnet32_close ( struct net_device *netdev )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
unsigned long ioaddr = priv->pci_dev->ioaddr; unsigned long ioaddr = priv->pci_dev->ioaddr;
DBGP ( "pcnet32_close\n" ); DBGP ( "pcnet32_close\n" );
@ -1003,7 +1003,7 @@ static void pcnet32_irq_disable ( struct pcnet32_private *priv )
static void static void
pcnet32_irq ( struct net_device *netdev, int action ) pcnet32_irq ( struct net_device *netdev, int action )
{ {
struct pcnet32_private *priv = netdev_priv ( netdev ); struct pcnet32_private *priv = netdev->priv;
DBGP ( "pcnet32_irq\n" ); DBGP ( "pcnet32_irq\n" );
@ -1061,7 +1061,7 @@ pcnet32_probe ( struct pci_device *pdev )
netdev->dev = &pdev->dev; netdev->dev = &pdev->dev;
/* Get a reference to our private data */ /* Get a reference to our private data */
priv = netdev_priv ( netdev ); priv = netdev->priv;
/* We'll need these set up for the rest of the routines */ /* We'll need these set up for the rest of the routines */
priv->pci_dev = pdev; priv->pci_dev = pdev;

View File

@ -1062,7 +1062,7 @@ static inline int phantom_del_macaddr ( struct phantom_nic *phantom,
* @v netdev Network device * @v netdev Network device
*/ */
static void phantom_poll_link_state ( struct net_device *netdev ) { static void phantom_poll_link_state ( struct net_device *netdev ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
uint32_t xg_state_p3; uint32_t xg_state_p3;
unsigned int link; unsigned int link;
@ -1109,7 +1109,7 @@ static void phantom_poll_link_state ( struct net_device *netdev ) {
* @v netdev Net device * @v netdev Net device
*/ */
static void phantom_refill_rx_ring ( struct net_device *netdev ) { static void phantom_refill_rx_ring ( struct net_device *netdev ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
struct io_buffer *iobuf; struct io_buffer *iobuf;
struct phantom_rds rds; struct phantom_rds rds;
unsigned int handle; unsigned int handle;
@ -1160,7 +1160,7 @@ static void phantom_refill_rx_ring ( struct net_device *netdev ) {
* @ret rc Return status code * @ret rc Return status code
*/ */
static int phantom_open ( struct net_device *netdev ) { static int phantom_open ( struct net_device *netdev ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
int rc; int rc;
/* Allocate and zero descriptor rings */ /* Allocate and zero descriptor rings */
@ -1220,7 +1220,7 @@ static int phantom_open ( struct net_device *netdev ) {
* @v netdev Net device * @v netdev Net device
*/ */
static void phantom_close ( struct net_device *netdev ) { static void phantom_close ( struct net_device *netdev ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int i; unsigned int i;
@ -1258,7 +1258,7 @@ static void phantom_close ( struct net_device *netdev ) {
*/ */
static int phantom_transmit ( struct net_device *netdev, static int phantom_transmit ( struct net_device *netdev,
struct io_buffer *iobuf ) { struct io_buffer *iobuf ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
union phantom_cds cds; union phantom_cds cds;
int index; int index;
@ -1297,7 +1297,7 @@ static int phantom_transmit ( struct net_device *netdev,
* @v netdev Network device * @v netdev Network device
*/ */
static void phantom_poll ( struct net_device *netdev ) { static void phantom_poll ( struct net_device *netdev ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int irq_vector; unsigned int irq_vector;
unsigned int irq_state; unsigned int irq_state;
@ -1434,7 +1434,7 @@ static void phantom_poll ( struct net_device *netdev ) {
* @v enable Interrupts should be enabled * @v enable Interrupts should be enabled
*/ */
static void phantom_irq ( struct net_device *netdev, int enable ) { static void phantom_irq ( struct net_device *netdev, int enable ) {
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
phantom_writel ( phantom, ( enable ? 1 : 0 ), phantom_writel ( phantom, ( enable ? 1 : 0 ),
phantom->sds_irq_mask_crb ); phantom->sds_irq_mask_crb );
@ -2070,7 +2070,7 @@ static int phantom_probe ( struct pci_device *pci ) {
goto err_alloc_etherdev; goto err_alloc_etherdev;
} }
netdev_init ( netdev, &phantom_operations ); netdev_init ( netdev, &phantom_operations );
phantom = netdev_priv ( netdev ); phantom = netdev->priv;
pci_set_drvdata ( pci, netdev ); pci_set_drvdata ( pci, netdev );
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
memset ( phantom, 0, sizeof ( *phantom ) ); memset ( phantom, 0, sizeof ( *phantom ) );
@ -2161,7 +2161,7 @@ static int phantom_probe ( struct pci_device *pci ) {
*/ */
static void phantom_remove ( struct pci_device *pci ) { static void phantom_remove ( struct pci_device *pci ) {
struct net_device *netdev = pci_get_drvdata ( pci ); struct net_device *netdev = pci_get_drvdata ( pci );
struct phantom_nic *phantom = netdev_priv ( netdev ); struct phantom_nic *phantom = netdev->priv;
unregister_settings ( &phantom->settings ); unregister_settings ( &phantom->settings );
unregister_netdev ( netdev ); unregister_netdev ( netdev );

View File

@ -70,7 +70,7 @@ efx_readl(struct efx_nic *efx, efx_dword_t *value, unsigned int reg)
******************************************************************************/ ******************************************************************************/
void efx_probe(struct net_device *netdev, enum efx_revision revision) void efx_probe(struct net_device *netdev, enum efx_revision revision)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct pci_device *pci = container_of(netdev->dev, struct pci_device *pci = container_of(netdev->dev,
struct pci_device, dev); struct pci_device, dev);
unsigned int reg = PCI_BASE_ADDRESS_0; unsigned int reg = PCI_BASE_ADDRESS_0;
@ -97,7 +97,7 @@ void efx_probe(struct net_device *netdev, enum efx_revision revision)
void efx_remove(struct net_device *netdev) void efx_remove(struct net_device *netdev)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
iounmap(efx->membase); iounmap(efx->membase);
efx->membase = NULL; efx->membase = NULL;

View File

@ -100,7 +100,7 @@ efx_hunt_notify_tx_desc(struct efx_nic *efx)
int int
efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob) efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_tx_queue *txq = &efx->txq; struct efx_tx_queue *txq = &efx->txq;
int fill_level, space; int fill_level, space;
efx_tx_desc_t *txd; efx_tx_desc_t *txd;
@ -155,7 +155,7 @@ efx_hunt_transmit_done(struct efx_nic *efx, int id)
int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr) int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_tx_queue *txq = &efx->txq; struct efx_tx_queue *txq = &efx->txq;
size_t bytes; size_t bytes;
@ -270,7 +270,7 @@ efx_hunt_receive(struct efx_nic *efx, unsigned int id, int len, int drop)
int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr) int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_rx_queue *rxq = &efx->rxq; struct efx_rx_queue *rxq = &efx->rxq;
size_t bytes; size_t bytes;
@ -294,7 +294,7 @@ int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr)
******************************************************************************/ ******************************************************************************/
int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr) int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_ev_queue *evq = &efx->evq; struct efx_ev_queue *evq = &efx->evq;
size_t bytes; size_t bytes;
@ -404,7 +404,7 @@ efx_hunt_handle_event(struct efx_nic *efx, efx_event_t *evt)
void efx_hunt_poll(struct net_device *netdev) void efx_hunt_poll(struct net_device *netdev)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_ev_queue *evq = &efx->evq; struct efx_ev_queue *evq = &efx->evq;
efx_event_t *evt; efx_event_t *evt;
int budget = 10; int budget = 10;
@ -443,7 +443,7 @@ void efx_hunt_poll(struct net_device *netdev)
void efx_hunt_irq(struct net_device *netdev, int enable) void efx_hunt_irq(struct net_device *netdev, int enable)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
efx->int_en = enable; efx->int_en = enable;
@ -465,7 +465,7 @@ void efx_hunt_irq(struct net_device *netdev, int enable)
******************************************************************************/ ******************************************************************************/
int efx_hunt_open(struct net_device *netdev) int efx_hunt_open(struct net_device *netdev)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
efx_dword_t cmd; efx_dword_t cmd;
/* Set interrupt moderation to 0*/ /* Set interrupt moderation to 0*/
@ -486,7 +486,7 @@ int efx_hunt_open(struct net_device *netdev)
void efx_hunt_close(struct net_device *netdev) void efx_hunt_close(struct net_device *netdev)
{ {
struct efx_nic *efx = netdev_priv(netdev); struct efx_nic *efx = netdev->priv;
struct efx_rx_queue *rxq = &efx->rxq; struct efx_rx_queue *rxq = &efx->rxq;
struct efx_tx_queue *txq = &efx->txq; struct efx_tx_queue *txq = &efx->txq;
int i; int i;

View File

@ -1043,7 +1043,7 @@ static void hunt_ev_fini(struct hunt_nic *hunt)
static void static void
hunt_poll(struct net_device *netdev) hunt_poll(struct net_device *netdev)
{ {
struct hunt_nic *hunt = netdev_priv(netdev); struct hunt_nic *hunt = netdev->priv;
/* If called while already polling, return immediately */ /* If called while already polling, return immediately */
if (hunt->efx.state & EFX_STATE_POLLING) if (hunt->efx.state & EFX_STATE_POLLING)
@ -1071,7 +1071,7 @@ hunt_poll(struct net_device *netdev)
******************************************************************************/ ******************************************************************************/
static int hunt_open(struct net_device *netdev) static int hunt_open(struct net_device *netdev)
{ {
struct hunt_nic *hunt = netdev_priv(netdev); struct hunt_nic *hunt = netdev->priv;
int rc; int rc;
/* Allocate VIs */ /* Allocate VIs */
@ -1133,7 +1133,7 @@ fail2:
static void hunt_close(struct net_device *netdev) static void hunt_close(struct net_device *netdev)
{ {
struct hunt_nic *hunt = netdev_priv(netdev); struct hunt_nic *hunt = netdev->priv;
/* Stop datapath */ /* Stop datapath */
efx_hunt_close(netdev); efx_hunt_close(netdev);
@ -1187,7 +1187,7 @@ hunt_probe(struct pci_device *pci)
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
netdev->state |= NETDEV_IRQ_UNSUPPORTED; netdev->state |= NETDEV_IRQ_UNSUPPORTED;
hunt = netdev_priv(netdev); hunt = netdev->priv;
memset(hunt, 0, sizeof(*hunt)); memset(hunt, 0, sizeof(*hunt));
efx = &hunt->efx; efx = &hunt->efx;
@ -1290,7 +1290,7 @@ fail1:
static void hunt_remove(struct pci_device *pci) static void hunt_remove(struct pci_device *pci)
{ {
struct net_device *netdev = pci_get_drvdata(pci); struct net_device *netdev = pci_get_drvdata(pci);
struct hunt_nic *hunt = netdev_priv(netdev); struct hunt_nic *hunt = netdev->priv;
if (!(hunt->flags & if (!(hunt->flags &
(1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT))) { (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT))) {

View File

@ -107,14 +107,14 @@ static int mdio_read(void *ioaddr, int phy_id, int reg)
static void __mdio_write(struct net_device *dev, int phy_id, int reg, int val) static void __mdio_write(struct net_device *dev, int phy_id, int reg, int val)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
mdio_write(tp->mmio_addr, phy_id, reg, val); mdio_write(tp->mmio_addr, phy_id, reg, val);
} }
static int __mdio_read(struct net_device *dev, int phy_id, int reg) static int __mdio_read(struct net_device *dev, int phy_id, int reg)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
return mdio_read(tp->mmio_addr, phy_id, reg); return mdio_read(tp->mmio_addr, phy_id, reg);
} }
@ -343,7 +343,7 @@ static void sis190_process_tx(struct sis190_private *tp)
*/ */
static void sis190_poll(struct net_device *dev) static void sis190_poll(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u32 status; u32 status;
@ -374,7 +374,7 @@ static inline void sis190_init_ring_indexes(struct sis190_private *tp)
static int sis190_init_ring(struct net_device *dev) static int sis190_init_ring(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
sis190_init_ring_indexes(tp); sis190_init_ring_indexes(tp);
@ -395,7 +395,7 @@ err:
static void sis190_set_rx_mode(struct net_device *dev) static void sis190_set_rx_mode(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u32 mc_filter[2]; /* Multicast hash filter */ u32 mc_filter[2]; /* Multicast hash filter */
u16 rx_mode; u16 rx_mode;
@ -419,7 +419,7 @@ static void sis190_soft_reset(void *ioaddr)
static void sis190_hw_start(struct net_device *dev) static void sis190_hw_start(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
sis190_soft_reset(ioaddr); sis190_soft_reset(ioaddr);
@ -548,7 +548,7 @@ static void sis190_phy_task(struct sis190_private *tp)
static int sis190_open(struct net_device *dev) static int sis190_open(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
int rc; int rc;
/* Allocate TX ring */ /* Allocate TX ring */
@ -587,7 +587,7 @@ error:
static void sis190_down(struct net_device *dev) static void sis190_down(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
do { do {
@ -597,7 +597,7 @@ static void sis190_down(struct net_device *dev)
static void sis190_free(struct net_device *dev) static void sis190_free(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
int i; int i;
free_phys(tp->TxDescRing, TX_RING_BYTES); free_phys(tp->TxDescRing, TX_RING_BYTES);
@ -630,7 +630,7 @@ static void sis190_close(struct net_device *dev)
static int sis190_transmit(struct net_device *dev, struct io_buffer *iob) static int sis190_transmit(struct net_device *dev, struct io_buffer *iob)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u32 len, entry; u32 len, entry;
struct TxDesc *desc; struct TxDesc *desc;
@ -804,7 +804,7 @@ static void sis190_mii_probe_88e1111_fixup(struct sis190_private *tp)
*/ */
static int sis190_mii_probe(struct net_device *dev) static int sis190_mii_probe(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
struct mii_if_info *mii_if = &tp->mii_if; struct mii_if_info *mii_if = &tp->mii_if;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
int phy_id; int phy_id;
@ -858,7 +858,7 @@ out:
static void sis190_mii_remove(struct net_device *dev) static void sis190_mii_remove(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
sis190_free_phy(&tp->first_phy); sis190_free_phy(&tp->first_phy);
} }
@ -879,7 +879,7 @@ static int sis190_init_board(struct pci_device *pdev, struct net_device **netdev
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
tp = netdev_priv(dev); tp = dev->priv;
memset(tp, 0, sizeof(*tp)); memset(tp, 0, sizeof(*tp));
tp->dev = dev; tp->dev = dev;
@ -916,7 +916,7 @@ static void sis190_set_rgmii(struct sis190_private *tp, u8 reg)
static int sis190_get_mac_addr_from_eeprom(struct pci_device *pdev __unused, static int sis190_get_mac_addr_from_eeprom(struct pci_device *pdev __unused,
struct net_device *dev) struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u16 sig; u16 sig;
int i; int i;
@ -955,7 +955,7 @@ static int sis190_get_mac_addr_from_eeprom(struct pci_device *pdev __unused,
static int sis190_get_mac_addr_from_apc(struct pci_device *pdev, static int sis190_get_mac_addr_from_apc(struct pci_device *pdev,
struct net_device *dev) struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
struct pci_device *isa_bridge = NULL; struct pci_device *isa_bridge = NULL;
struct device *d; struct device *d;
u8 reg, tmp8; u8 reg, tmp8;
@ -1018,7 +1018,7 @@ static int sis190_get_mac_addr_from_apc(struct pci_device *pdev,
*/ */
static inline void sis190_init_rxfilter(struct net_device *dev) static inline void sis190_init_rxfilter(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u16 ctl; u16 ctl;
int i; int i;
@ -1057,7 +1057,7 @@ static int sis190_get_mac_addr(struct pci_device *pdev,
static void sis190_set_speed_auto(struct net_device *dev) static void sis190_set_speed_auto(struct net_device *dev)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
int phy_id = tp->mii_if.phy_id; int phy_id = tp->mii_if.phy_id;
int val; int val;
@ -1082,7 +1082,7 @@ static void sis190_set_speed_auto(struct net_device *dev)
static void sis190_irq(struct net_device *dev, int enable) static void sis190_irq(struct net_device *dev, int enable)
{ {
struct sis190_private *tp = netdev_priv(dev); struct sis190_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
SIS_W32(IntrStatus, 0xffffffff); SIS_W32(IntrStatus, 0xffffffff);
@ -1116,7 +1116,7 @@ static int sis190_probe(struct pci_device *pdev)
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
tp = netdev_priv(dev); tp = dev->priv;
rc = sis190_get_mac_addr(pdev, dev); rc = sis190_get_mac_addr(pdev, dev);
if (rc < 0) if (rc < 0)

View File

@ -213,7 +213,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
* *
* static int skge_get_eeprom_len(struct net_device *dev) * static int skge_get_eeprom_len(struct net_device *dev)
* { * {
* struct skge_port *skge = netdev_priv(dev); * struct skge_port *skge = dev->priv;
* u32 reg2; * u32 reg2;
* *
* pci_read_config_dword(skge->hw->pdev, PCI_DEV_REG2, &reg2); * pci_read_config_dword(skge->hw->pdev, PCI_DEV_REG2, &reg2);
@ -248,7 +248,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
* static int skge_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, * static int skge_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
* u8 *data) * u8 *data)
* { * {
* struct skge_port *skge = netdev_priv(dev); * struct skge_port *skge = dev->priv;
* struct pci_dev *pdev = skge->hw->pdev; * struct pci_dev *pdev = skge->hw->pdev;
* int cap = pci_find_capability(pdev, PCI_CAP_ID_VPD); * int cap = pci_find_capability(pdev, PCI_CAP_ID_VPD);
* int length = eeprom->len; * int length = eeprom->len;
@ -274,7 +274,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
* static int skge_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, * static int skge_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
* u8 *data) * u8 *data)
* { * {
* struct skge_port *skge = netdev_priv(dev); * struct skge_port *skge = dev->priv;
* struct pci_dev *pdev = skge->hw->pdev; * struct pci_dev *pdev = skge->hw->pdev;
* int cap = pci_find_capability(pdev, PCI_CAP_ID_VPD); * int cap = pci_find_capability(pdev, PCI_CAP_ID_VPD);
* int length = eeprom->len; * int length = eeprom->len;
@ -415,7 +415,7 @@ static void skge_link_down(struct skge_port *skge)
static void xm_link_down(struct skge_hw *hw, int port) static void xm_link_down(struct skge_hw *hw, int port)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE); xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE);
@ -553,7 +553,7 @@ static const u16 fiber_pause_map[] = {
static void bcom_check_link(struct skge_hw *hw, int port) static void bcom_check_link(struct skge_hw *hw, int port)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
u16 status; u16 status;
/* read twice because of latch */ /* read twice because of latch */
@ -751,7 +751,7 @@ static void xm_phy_init(struct skge_port *skge)
static int xm_check_link(struct net_device *dev) static int xm_check_link(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
u16 status; u16 status;
@ -852,7 +852,7 @@ static void xm_link_timer(struct skge_port *skge)
static void genesis_mac_init(struct skge_hw *hw, int port) static void genesis_mac_init(struct skge_hw *hw, int port)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
int i; int i;
u32 r; u32 r;
const u8 zero[6] = { 0 }; const u8 zero[6] = { 0 };
@ -1209,7 +1209,7 @@ static u16 gm_phy_read(struct skge_hw *hw, int port, u16 reg)
/* Marvell Phy Initialization */ /* Marvell Phy Initialization */
static void yukon_init(struct skge_hw *hw, int port) static void yukon_init(struct skge_hw *hw, int port)
{ {
struct skge_port *skge = netdev_priv(hw->dev[port]); struct skge_port *skge = hw->dev[port]->priv;
u16 ctrl, ct1000, adv; u16 ctrl, ct1000, adv;
if (skge->autoneg == AUTONEG_ENABLE) { if (skge->autoneg == AUTONEG_ENABLE) {
@ -1325,7 +1325,7 @@ static int is_yukon_lite_a0(struct skge_hw *hw)
static void yukon_mac_init(struct skge_hw *hw, int port) static void yukon_mac_init(struct skge_hw *hw, int port)
{ {
struct skge_port *skge = netdev_priv(hw->dev[port]); struct skge_port *skge = hw->dev[port]->priv;
int i; int i;
u32 reg; u32 reg;
const u8 *addr = hw->dev[port]->ll_addr; const u8 *addr = hw->dev[port]->ll_addr;
@ -1691,7 +1691,7 @@ static void skge_qset(struct skge_port *skge, u16 q,
void skge_free(struct net_device *dev) void skge_free(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
free(skge->rx_ring.start); free(skge->rx_ring.start);
skge->rx_ring.start = NULL; skge->rx_ring.start = NULL;
@ -1706,7 +1706,7 @@ void skge_free(struct net_device *dev)
static int skge_up(struct net_device *dev) static int skge_up(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
u32 chunk, ram_addr; u32 chunk, ram_addr;
@ -1789,7 +1789,7 @@ static void skge_rx_stop(struct skge_hw *hw, int port)
static void skge_down(struct net_device *dev) static void skge_down(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
@ -1862,7 +1862,7 @@ static inline int skge_tx_avail(const struct skge_ring *ring)
static int skge_xmit_frame(struct net_device *dev, struct io_buffer *iob) static int skge_xmit_frame(struct net_device *dev, struct io_buffer *iob)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
struct skge_element *e; struct skge_element *e;
struct skge_tx_desc *td; struct skge_tx_desc *td;
@ -1908,7 +1908,7 @@ static int skge_xmit_frame(struct net_device *dev, struct io_buffer *iob)
/* Free all buffers in transmit ring */ /* Free all buffers in transmit ring */
static void skge_tx_clean(struct net_device *dev) static void skge_tx_clean(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_element *e; struct skge_element *e;
for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) { for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) {
@ -1939,7 +1939,7 @@ static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
/* Free all buffers in Tx ring which are no longer owned by device */ /* Free all buffers in Tx ring which are no longer owned by device */
static void skge_tx_done(struct net_device *dev) static void skge_tx_done(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_ring *ring = &skge->tx_ring; struct skge_ring *ring = &skge->tx_ring;
struct skge_element *e; struct skge_element *e;
@ -1961,7 +1961,7 @@ static void skge_tx_done(struct net_device *dev)
static void skge_rx_refill(struct net_device *dev) static void skge_rx_refill(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_ring *ring = &skge->rx_ring; struct skge_ring *ring = &skge->rx_ring;
struct skge_element *e; struct skge_element *e;
struct io_buffer *iob; struct io_buffer *iob;
@ -2003,7 +2003,7 @@ static void skge_rx_refill(struct net_device *dev)
static void skge_rx_done(struct net_device *dev) static void skge_rx_done(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_ring *ring = &skge->rx_ring; struct skge_ring *ring = &skge->rx_ring;
struct skge_rx_desc *rd; struct skge_rx_desc *rd;
struct skge_element *e; struct skge_element *e;
@ -2050,7 +2050,7 @@ static void skge_rx_done(struct net_device *dev)
static void skge_poll(struct net_device *dev) static void skge_poll(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
u32 status; u32 status;
@ -2085,7 +2085,7 @@ static void skge_phyirq(struct skge_hw *hw)
for (port = 0; port < hw->ports; port++) { for (port = 0; port < hw->ports; port++) {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
if (hw->chip_id != CHIP_ID_GENESIS) if (hw->chip_id != CHIP_ID_GENESIS)
yukon_phy_intr(skge); yukon_phy_intr(skge);
@ -2302,7 +2302,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
dev->dev = &hw->pdev->dev; dev->dev = &hw->pdev->dev;
skge = netdev_priv(dev); skge = dev->priv;
skge->netdev = dev; skge->netdev = dev;
skge->hw = hw; skge->hw = hw;
@ -2446,7 +2446,7 @@ static void skge_remove(struct pci_device *pdev)
* This is a iPXE Network Driver API function. * This is a iPXE Network Driver API function.
*/ */
static void skge_net_irq ( struct net_device *dev, int enable ) { static void skge_net_irq ( struct net_device *dev, int enable ) {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = dev->priv;
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
if (enable) if (enable)

View File

@ -296,7 +296,7 @@ static const u16 gm_fc_disable[] = {
static void sky2_phy_init(struct sky2_hw *hw, unsigned port) static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
{ {
struct sky2_port *sky2 = netdev_priv(hw->dev[port]); struct sky2_port *sky2 = hw->dev[port]->priv;
u16 ctrl, ct1000, adv, pg, ledctrl, ledover, reg; u16 ctrl, ct1000, adv, pg, ledctrl, ledover, reg;
if (sky2->autoneg == AUTONEG_ENABLE && if (sky2->autoneg == AUTONEG_ENABLE &&
@ -1128,7 +1128,7 @@ static void sky2_free_rings(struct sky2_port *sky2)
/* Bring up network interface. */ /* Bring up network interface. */
static int sky2_up(struct net_device *dev) static int sky2_up(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port; unsigned port = sky2->port;
u32 imask, ramsize; u32 imask, ramsize;
@ -1237,7 +1237,7 @@ static inline int tx_avail(const struct sky2_port *sky2)
*/ */
static int sky2_xmit_frame(struct net_device *dev, struct io_buffer *iob) static int sky2_xmit_frame(struct net_device *dev, struct io_buffer *iob)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
struct sky2_tx_le *le = NULL; struct sky2_tx_le *le = NULL;
struct tx_ring_info *re; struct tx_ring_info *re;
@ -1303,7 +1303,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
/* Cleanup all untransmitted buffers, assume transmitter not running */ /* Cleanup all untransmitted buffers, assume transmitter not running */
static void sky2_tx_clean(struct net_device *dev) static void sky2_tx_clean(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
sky2_tx_complete(sky2, sky2->tx_prod); sky2_tx_complete(sky2, sky2->tx_prod);
} }
@ -1311,7 +1311,7 @@ static void sky2_tx_clean(struct net_device *dev)
/* Network shutdown */ /* Network shutdown */
static void sky2_down(struct net_device *dev) static void sky2_down(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port; unsigned port = sky2->port;
u16 ctrl; u16 ctrl;
@ -1511,7 +1511,7 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
u16 istatus, phystat; u16 istatus, phystat;
istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT);
@ -1570,7 +1570,7 @@ static struct io_buffer *receive_new(struct sky2_port *sky2,
static struct io_buffer *sky2_receive(struct net_device *dev, static struct io_buffer *sky2_receive(struct net_device *dev,
u16 length, u32 status) u16 length, u32 status)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next; struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next;
struct io_buffer *iob = NULL; struct io_buffer *iob = NULL;
u16 count = (status & GMR_FS_LEN) >> 16; u16 count = (status & GMR_FS_LEN) >> 16;
@ -1634,7 +1634,7 @@ error:
/* Transmit complete */ /* Transmit complete */
static inline void sky2_tx_done(struct net_device *dev, u16 last) static inline void sky2_tx_done(struct net_device *dev, u16 last)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
sky2_tx_complete(sky2, last); sky2_tx_complete(sky2, last);
} }
@ -1700,10 +1700,10 @@ static void sky2_status_intr(struct sky2_hw *hw, u16 idx)
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
if (rx[0]) if (rx[0])
sky2_rx_update(netdev_priv(hw->dev[0]), Q_R1); sky2_rx_update(hw->dev[0]->priv, Q_R1);
if (rx[1]) if (rx[1])
sky2_rx_update(netdev_priv(hw->dev[1]), Q_R2); sky2_rx_update(hw->dev[1]->priv, Q_R2);
} }
static void sky2_hw_error(struct sky2_hw *hw, unsigned port, u32 status) static void sky2_hw_error(struct sky2_hw *hw, unsigned port, u32 status)
@ -1809,7 +1809,7 @@ static void sky2_le_error(struct sky2_hw *hw, unsigned port,
u16 q, unsigned ring_size __unused) u16 q, unsigned ring_size __unused)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
int idx; int idx;
const u64 *le = (q == Q_R1 || q == Q_R2) const u64 *le = (q == Q_R1 || q == Q_R2)
? (u64 *) sky2->rx_le : (u64 *) sky2->tx_le; ? (u64 *) sky2->rx_le : (u64 *) sky2->tx_le;
@ -1853,7 +1853,7 @@ static void sky2_err_intr(struct sky2_hw *hw, u32 status)
static void sky2_poll(struct net_device *dev) static void sky2_poll(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
u32 status = sky2_read32(hw, B0_Y2_SP_EISR); u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
u16 idx; u16 idx;
@ -2152,7 +2152,7 @@ static u32 sky2_supported_modes(const struct sky2_hw *hw)
static void sky2_set_multicast(struct net_device *dev) static void sky2_set_multicast(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port; unsigned port = sky2->port;
u16 reg; u16 reg;
@ -2189,7 +2189,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw,
dev->dev = &hw->pdev->dev; dev->dev = &hw->pdev->dev;
sky2 = netdev_priv(dev); sky2 = dev->priv;
sky2->netdev = dev; sky2->netdev = dev;
sky2->hw = hw; sky2->hw = hw;
@ -2241,7 +2241,7 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
static void sky2_net_irq(struct net_device *dev, int enable) static void sky2_net_irq(struct net_device *dev, int enable)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = dev->priv;
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
u32 imask = sky2_read32(hw, B0_IMSK); u32 imask = sky2_read32(hw, B0_IMSK);

View File

@ -233,7 +233,7 @@ int tg3_init_rings(struct tg3 *tp)
static int tg3_open(struct net_device *dev) static int tg3_open(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
struct tg3_rx_prodring_set *tpr = &tp->prodring; struct tg3_rx_prodring_set *tpr = &tp->prodring;
int err = 0; int err = 0;
@ -299,7 +299,7 @@ static void __unused tw32_mailbox2(struct tg3 *tp, uint32_t reg, uint32_t val)
static int tg3_transmit(struct net_device *dev, struct io_buffer *iob) static int tg3_transmit(struct net_device *dev, struct io_buffer *iob)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
u32 len, entry; u32 len, entry;
dma_addr_t mapping; dma_addr_t mapping;
@ -333,7 +333,7 @@ static int tg3_transmit(struct net_device *dev, struct io_buffer *iob)
static void tg3_tx_complete(struct net_device *dev) static void tg3_tx_complete(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
u32 hw_idx = tp->hw_status->idx[0].tx_consumer; u32 hw_idx = tp->hw_status->idx[0].tx_consumer;
u32 sw_idx = tp->tx_cons; u32 sw_idx = tp->tx_cons;
@ -427,7 +427,7 @@ static void tg3_refill_prod_ring(struct tg3 *tp)
static void tg3_rx_complete(struct net_device *dev) static void tg3_rx_complete(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
u32 sw_idx = tp->rx_rcb_ptr; u32 sw_idx = tp->rx_rcb_ptr;
u16 hw_idx; u16 hw_idx;
@ -478,7 +478,7 @@ static void tg3_rx_complete(struct net_device *dev)
static void tg3_poll(struct net_device *dev) static void tg3_poll(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
/* ACK interrupts */ /* ACK interrupts */
/* /*
@ -496,7 +496,7 @@ static void tg3_poll(struct net_device *dev)
static void tg3_close(struct net_device *dev) static void tg3_close(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
DBGP("%s\n", __func__); DBGP("%s\n", __func__);
@ -511,7 +511,7 @@ static void tg3_close(struct net_device *dev)
static void tg3_irq(struct net_device *dev, int enable) static void tg3_irq(struct net_device *dev, int enable)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
DBGP("%s: %d\n", __func__, enable); DBGP("%s: %d\n", __func__, enable);
@ -735,7 +735,7 @@ static int tg3_init_one(struct pci_device *pdev)
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
tp = netdev_priv(dev); tp = dev->priv;
tp->pdev = pdev; tp->pdev = pdev;
tp->dev = dev; tp->dev = dev;
tp->rx_mode = TG3_DEF_RX_MODE; tp->rx_mode = TG3_DEF_RX_MODE;

View File

@ -1717,7 +1717,7 @@ int tg3_get_device_address(struct tg3 *tp)
static void __tg3_set_rx_mode(struct net_device *dev) static void __tg3_set_rx_mode(struct net_device *dev)
{ DBGP("%s\n", __func__); { DBGP("%s\n", __func__);
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = dev->priv;
u32 rx_mode; u32 rx_mode;
rx_mode = tp->rx_mode & ~(RX_MODE_PROMISC | rx_mode = tp->rx_mode & ~(RX_MODE_PROMISC |

View File

@ -90,7 +90,7 @@ static inline uint32_t vmxnet3_command ( struct vmxnet3_nic *vmxnet,
*/ */
static int vmxnet3_transmit ( struct net_device *netdev, static int vmxnet3_transmit ( struct net_device *netdev,
struct io_buffer *iobuf ) { struct io_buffer *iobuf ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct vmxnet3_tx_desc *tx_desc; struct vmxnet3_tx_desc *tx_desc;
unsigned int fill; unsigned int fill;
unsigned int desc_idx; unsigned int desc_idx;
@ -139,7 +139,7 @@ static int vmxnet3_transmit ( struct net_device *netdev,
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_poll_tx ( struct net_device *netdev ) { static void vmxnet3_poll_tx ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct vmxnet3_tx_comp *tx_comp; struct vmxnet3_tx_comp *tx_comp;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int comp_idx; unsigned int comp_idx;
@ -188,7 +188,7 @@ static void vmxnet3_poll_tx ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_flush_tx ( struct net_device *netdev ) { static void vmxnet3_flush_tx ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
unsigned int i; unsigned int i;
for ( i = 0 ; i < VMXNET3_NUM_TX_DESC ; i++ ) { for ( i = 0 ; i < VMXNET3_NUM_TX_DESC ; i++ ) {
@ -206,7 +206,7 @@ static void vmxnet3_flush_tx ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_refill_rx ( struct net_device *netdev ) { static void vmxnet3_refill_rx ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct vmxnet3_rx_desc *rx_desc; struct vmxnet3_rx_desc *rx_desc;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int orig_rx_prod = vmxnet->count.rx_prod; unsigned int orig_rx_prod = vmxnet->count.rx_prod;
@ -261,7 +261,7 @@ static void vmxnet3_refill_rx ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_poll_rx ( struct net_device *netdev ) { static void vmxnet3_poll_rx ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct vmxnet3_rx_comp *rx_comp; struct vmxnet3_rx_comp *rx_comp;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int comp_idx; unsigned int comp_idx;
@ -315,7 +315,7 @@ static void vmxnet3_poll_rx ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_flush_rx ( struct net_device *netdev ) { static void vmxnet3_flush_rx ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct io_buffer *iobuf; struct io_buffer *iobuf;
unsigned int i; unsigned int i;
@ -333,7 +333,7 @@ static void vmxnet3_flush_rx ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_check_link ( struct net_device *netdev ) { static void vmxnet3_check_link ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
uint32_t state; uint32_t state;
int link_up; int link_up;
unsigned int link_speed; unsigned int link_speed;
@ -360,7 +360,7 @@ static void vmxnet3_check_link ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_poll_events ( struct net_device *netdev ) { static void vmxnet3_poll_events ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
uint32_t events; uint32_t events;
/* Do nothing unless there are events to process */ /* Do nothing unless there are events to process */
@ -424,7 +424,7 @@ static void vmxnet3_poll ( struct net_device *netdev ) {
* @v enable Interrupts should be enabled * @v enable Interrupts should be enabled
*/ */
static void vmxnet3_irq ( struct net_device *netdev, int enable ) { static void vmxnet3_irq ( struct net_device *netdev, int enable ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
DBGC ( vmxnet, "VMXNET3 %p %s IRQ not implemented\n", DBGC ( vmxnet, "VMXNET3 %p %s IRQ not implemented\n",
vmxnet, ( enable ? "enable" : "disable" ) ); vmxnet, ( enable ? "enable" : "disable" ) );
@ -456,7 +456,7 @@ static void vmxnet3_set_ll_addr ( struct vmxnet3_nic *vmxnet,
* @ret rc Return status code * @ret rc Return status code
*/ */
static int vmxnet3_open ( struct net_device *netdev ) { static int vmxnet3_open ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
struct vmxnet3_shared *shared; struct vmxnet3_shared *shared;
struct vmxnet3_queues *queues; struct vmxnet3_queues *queues;
uint64_t shared_bus; uint64_t shared_bus;
@ -554,7 +554,7 @@ static int vmxnet3_open ( struct net_device *netdev ) {
* @v netdev Network device * @v netdev Network device
*/ */
static void vmxnet3_close ( struct net_device *netdev ) { static void vmxnet3_close ( struct net_device *netdev ) {
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
vmxnet3_command ( vmxnet, VMXNET3_CMD_QUIESCE_DEV ); vmxnet3_command ( vmxnet, VMXNET3_CMD_QUIESCE_DEV );
vmxnet3_command ( vmxnet, VMXNET3_CMD_RESET_DEV ); vmxnet3_command ( vmxnet, VMXNET3_CMD_RESET_DEV );
@ -633,7 +633,7 @@ static int vmxnet3_probe ( struct pci_device *pci ) {
goto err_alloc_etherdev; goto err_alloc_etherdev;
} }
netdev_init ( netdev, &vmxnet3_operations ); netdev_init ( netdev, &vmxnet3_operations );
vmxnet = netdev_priv ( netdev ); vmxnet = netdev->priv;
pci_set_drvdata ( pci, netdev ); pci_set_drvdata ( pci, netdev );
netdev->dev = &pci->dev; netdev->dev = &pci->dev;
memset ( vmxnet, 0, sizeof ( *vmxnet ) ); memset ( vmxnet, 0, sizeof ( *vmxnet ) );
@ -699,7 +699,7 @@ static int vmxnet3_probe ( struct pci_device *pci ) {
*/ */
static void vmxnet3_remove ( struct pci_device *pci ) { static void vmxnet3_remove ( struct pci_device *pci ) {
struct net_device *netdev = pci_get_drvdata ( pci ); struct net_device *netdev = pci_get_drvdata ( pci );
struct vmxnet3_nic *vmxnet = netdev_priv ( netdev ); struct vmxnet3_nic *vmxnet = netdev->priv;
unregister_netdev ( netdev ); unregister_netdev ( netdev );
iounmap ( vmxnet->vd ); iounmap ( vmxnet->vd );

View File

@ -186,7 +186,7 @@ vxge_xmit(struct net_device *dev, struct io_buffer *iobuf)
vxge_trace(); vxge_trace();
vdev = (struct vxgedev *)netdev_priv(dev); vdev = (struct vxgedev *)dev->priv;
if (!is_vxge_card_up(vdev)) { if (!is_vxge_card_up(vdev)) {
vxge_debug(VXGE_ERR, vxge_debug(VXGE_ERR,
@ -235,7 +235,7 @@ static void vxge_poll(struct net_device *ndev)
vxge_debug(VXGE_POLL, "%s:%d \n", __func__, __LINE__); vxge_debug(VXGE_POLL, "%s:%d \n", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(ndev); vdev = (struct vxgedev *)ndev->priv;
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
if (!is_vxge_card_up(vdev)) if (!is_vxge_card_up(vdev))
@ -263,7 +263,7 @@ static void vxge_irq(struct net_device *netdev __unused, int action)
vxge_debug(VXGE_INFO, vxge_debug(VXGE_INFO,
"%s:%d action(%d)\n", __func__, __LINE__, action); "%s:%d action(%d)\n", __func__, __LINE__, action);
vdev = (struct vxgedev *)netdev_priv(netdev); vdev = (struct vxgedev *)netdev->priv;
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
switch (action) { switch (action) {
@ -297,7 +297,7 @@ vxge_open(struct net_device *dev)
vxge_debug(VXGE_INFO, "%s: %s:%d\n", vxge_debug(VXGE_INFO, "%s: %s:%d\n",
VXGE_DRIVER_NAME, __func__, __LINE__); VXGE_DRIVER_NAME, __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = (struct vxgedev *)dev->priv;
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
/* make sure you have link off by default every time Nic is /* make sure you have link off by default every time Nic is
@ -369,7 +369,7 @@ static void vxge_close(struct net_device *dev)
vxge_debug(VXGE_INFO, "%s: %s:%d\n", vxge_debug(VXGE_INFO, "%s: %s:%d\n",
dev->name, __func__, __LINE__); dev->name, __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = (struct vxgedev *)dev->priv;
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
if (!is_vxge_card_up(vdev)) if (!is_vxge_card_up(vdev))
@ -420,7 +420,7 @@ int vxge_device_register(struct __vxge_hw_device *hldev,
vxge_debug(VXGE_INFO, "%s:%d netdev registering\n", vxge_debug(VXGE_INFO, "%s:%d netdev registering\n",
__func__, __LINE__); __func__, __LINE__);
vdev = netdev_priv(ndev); vdev = ndev->priv;
memset(vdev, 0, sizeof(struct vxgedev)); memset(vdev, 0, sizeof(struct vxgedev));
vdev->ndev = ndev; vdev->ndev = ndev;
@ -683,7 +683,7 @@ vxge_remove(struct pci_device *pdev)
return; return;
ndev = hldev->ndev; ndev = hldev->ndev;
vdev = netdev_priv(ndev); vdev = ndev->priv;
iounmap(vdev->bar0); iounmap(vdev->bar0);

View File

@ -568,17 +568,6 @@ netdev_put ( struct net_device *netdev ) {
ref_put ( &netdev->refcnt ); ref_put ( &netdev->refcnt );
} }
/**
* Get driver private area for this network device
*
* @v netdev Network device
* @ret priv Driver private area for this network device
*/
static inline __attribute__ (( always_inline )) void *
netdev_priv ( struct net_device *netdev ) {
return netdev->priv;
}
/** /**
* Get per-netdevice configuration settings block * Get per-netdevice configuration settings block
* *