Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121848
b: refs/heads/master
c: 454d7c9
h: refs/heads/master
v: v3
  • Loading branch information
Wang Chen authored and David S. Miller committed Nov 13, 2008
1 parent 371c129 commit 99eae3f
Show file tree
Hide file tree
Showing 33 changed files with 230 additions and 230 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: 7a12122c7a00347da9669cfcde82954c9e3d6f5e
refs/heads/master: 454d7c9b14e20fd1949e2686e9de4a2926e01476
2 changes: 1 addition & 1 deletion trunk/drivers/net/3c501.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
if (el_debug)
printk(KERN_DEBUG "%s", version);

memset(dev->priv, 0, sizeof(struct net_local));
lp = netdev_priv(dev);
memset(lp, 0, sizeof(struct net_local));
spin_lock_init(&lp->lock);

/*
Expand Down
45 changes: 19 additions & 26 deletions trunk/drivers/net/3c505.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ static inline int inb_command(unsigned int base_addr)
static inline void outb_control(unsigned char val, struct net_device *dev)
{
outb(val, dev->base_addr + PORT_CONTROL);
((elp_device *)(dev->priv))->hcr_val = val;
((elp_device *)(netdev_priv(dev)))->hcr_val = val;
}

#define HCR_VAL(x) (((elp_device *)((x)->priv))->hcr_val)
#define HCR_VAL(x) (((elp_device *)(netdev_priv(x)))->hcr_val)

static inline void outb_command(unsigned char val, unsigned int base_addr)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ static inline int get_status(unsigned int base_addr)

static inline void set_hsf(struct net_device *dev, int hsf)
{
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
unsigned long flags;

spin_lock_irqsave(&adapter->lock, flags);
Expand All @@ -260,7 +260,7 @@ static bool start_receive(struct net_device *, pcb_struct *);
static inline void adapter_reset(struct net_device *dev)
{
unsigned long timeout;
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
unsigned char orig_hcr = adapter->hcr_val;

outb_control(0, dev);
Expand Down Expand Up @@ -293,7 +293,7 @@ static inline void adapter_reset(struct net_device *dev)
*/
static inline void check_3c505_dma(struct net_device *dev)
{
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) {
unsigned long flags, f;
printk(KERN_ERR "%s: DMA %s timed out, %d bytes left\n", dev->name, adapter->current_dma.direction ? "download" : "upload", get_dma_residue(dev->dma));
Expand Down Expand Up @@ -340,7 +340,7 @@ static inline bool send_pcb_fast(unsigned int base_addr, unsigned char byte)
/* Check to see if the receiver needs restarting, and kick it if so */
static inline void prime_rx(struct net_device *dev)
{
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
while (adapter->rx_active < ELP_RX_PCBS && netif_running(dev)) {
if (!start_receive(dev, &adapter->itx_pcb))
break;
Expand Down Expand Up @@ -375,7 +375,7 @@ static bool send_pcb(struct net_device *dev, pcb_struct * pcb)
{
int i;
unsigned long timeout;
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
unsigned long flags;

check_3c505_dma(dev);
Expand Down Expand Up @@ -463,7 +463,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
unsigned long timeout;
unsigned long flags;

elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);

set_hsf(dev, 0);

Expand Down Expand Up @@ -543,7 +543,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb)
{
bool status;
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);

if (elp_debug >= 3)
printk(KERN_DEBUG "%s: restarting receiver\n", dev->name);
Expand Down Expand Up @@ -571,7 +571,7 @@ static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb)
static void receive_packet(struct net_device *dev, int len)
{
int rlen;
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
void *target;
struct sk_buff *skb;
unsigned long flags;
Expand Down Expand Up @@ -638,13 +638,10 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
int len;
int dlen;
int icount = 0;
struct net_device *dev;
elp_device *adapter;
struct net_device *dev = dev_id;
elp_device *adapter = netdev_priv(dev);
unsigned long timeout;

dev = dev_id;
adapter = (elp_device *) dev->priv;

spin_lock(&adapter->lock);

do {
Expand Down Expand Up @@ -837,11 +834,9 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)

static int elp_open(struct net_device *dev)
{
elp_device *adapter;
elp_device *adapter = netdev_priv(dev);
int retval;

adapter = dev->priv;

if (elp_debug >= 3)
printk(KERN_DEBUG "%s: request to open device\n", dev->name);

Expand Down Expand Up @@ -970,7 +965,7 @@ static int elp_open(struct net_device *dev)

static bool send_packet(struct net_device *dev, struct sk_buff *skb)
{
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
unsigned long target;
unsigned long flags;

Expand Down Expand Up @@ -1061,7 +1056,7 @@ static void elp_timeout(struct net_device *dev)
static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
unsigned long flags;
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);

spin_lock_irqsave(&adapter->lock, flags);
check_3c505_dma(dev);
Expand Down Expand Up @@ -1103,7 +1098,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)

static struct net_device_stats *elp_get_stats(struct net_device *dev)
{
elp_device *adapter = (elp_device *) dev->priv;
elp_device *adapter = netdev_priv(dev);

if (elp_debug >= 3)
printk(KERN_DEBUG "%s: request for stats\n", dev->name);
Expand Down Expand Up @@ -1165,9 +1160,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {

static int elp_close(struct net_device *dev)
{
elp_device *adapter;

adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);

if (elp_debug >= 3)
printk(KERN_DEBUG "%s: request to close device\n", dev->name);
Expand Down Expand Up @@ -1208,7 +1201,7 @@ static int elp_close(struct net_device *dev)

static void elp_set_mc_list(struct net_device *dev)
{
elp_device *adapter = (elp_device *) dev->priv;
elp_device *adapter = netdev_priv(dev);
struct dev_mc_list *dmi = dev->mc_list;
int i;
unsigned long flags;
Expand Down Expand Up @@ -1379,7 +1372,7 @@ static int __init elp_autodetect(struct net_device *dev)

static int __init elplus_setup(struct net_device *dev)
{
elp_device *adapter = dev->priv;
elp_device *adapter = netdev_priv(dev);
int i, tries, tries1, okay;
unsigned long timeout;
unsigned long cookie = 0;
Expand Down
29 changes: 15 additions & 14 deletions trunk/drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int elmc_open(struct net_device *dev)

static int __init check586(struct net_device *dev, unsigned long where, unsigned size)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);
char *iscp_addrs[2];
int i = 0;

Expand Down Expand Up @@ -349,7 +349,7 @@ static int __init check586(struct net_device *dev, unsigned long where, unsigned

void alloc586(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

elmc_id_reset586();
DELAY(2);
Expand Down Expand Up @@ -415,7 +415,7 @@ static int __init do_elmc_probe(struct net_device *dev)
int i = 0;
unsigned int size = 0;
int retval;
struct priv *pr = dev->priv;
struct priv *pr = netdev_priv(dev);

if (MCA_bus == 0) {
return -ENODEV;
Expand Down Expand Up @@ -578,7 +578,8 @@ static int __init do_elmc_probe(struct net_device *dev)

static void cleanup_card(struct net_device *dev)
{
mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL);
mca_set_adapter_procfn(((struct priv *)netdev_priv(dev))->slot,
NULL, NULL);
release_region(dev->base_addr, ELMC_IO_EXTENT);
}

Expand Down Expand Up @@ -614,7 +615,7 @@ static int init586(struct net_device *dev)
void *ptr;
unsigned long s;
int i, result = 0;
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);
volatile struct configure_cmd_struct *cfg_cmd;
volatile struct iasetup_cmd_struct *ias_cmd;
volatile struct tdr_cmd_struct *tdr_cmd;
Expand Down Expand Up @@ -850,7 +851,7 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
volatile struct rfd_struct *rfd = (struct rfd_struct *) ptr;
volatile struct rbd_struct *rbd;
int i;
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

memset((char *) rfd, 0, sizeof(struct rfd_struct) * p->num_recv_buffs);
p->rfd_first = rfd;
Expand Down Expand Up @@ -911,7 +912,7 @@ elmc_interrupt(int irq, void *dev_id)
}
/* reading ELMC_CTRL also clears the INT bit. */

p = (struct priv *) dev->priv;
p = netdev_priv(dev);

while ((stat = p->scb->status & STAT_MASK))
{
Expand Down Expand Up @@ -967,7 +968,7 @@ static void elmc_rcv_int(struct net_device *dev)
unsigned short totlen;
struct sk_buff *skb;
struct rbd_struct *rbd;
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

for (; (status = p->rfd_top->status) & STAT_COMPL;) {
rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset);
Expand Down Expand Up @@ -1010,7 +1011,7 @@ static void elmc_rcv_int(struct net_device *dev)

static void elmc_rnr_int(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

dev->stats.rx_errors++;

Expand All @@ -1033,7 +1034,7 @@ static void elmc_rnr_int(struct net_device *dev)
static void elmc_xmt_int(struct net_device *dev)
{
int status;
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

status = p->xmit_cmds[p->xmit_last]->cmd_status;
if (!(status & STAT_COMPL)) {
Expand Down Expand Up @@ -1076,7 +1077,7 @@ static void elmc_xmt_int(struct net_device *dev)

static void startrecv586(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

p->scb->rfa_offset = make16(p->rfd_first);
p->scb->cmd = RUC_START;
Expand All @@ -1090,7 +1091,7 @@ static void startrecv586(struct net_device *dev)

static void elmc_timeout(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);
/* COMMAND-UNIT active? */
if (p->scb->status & CU_ACTIVE) {
#ifdef DEBUG
Expand Down Expand Up @@ -1126,7 +1127,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
#ifndef NO_NOPCOMMANDS
int next_nop;
#endif
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);

netif_stop_queue(dev);

Expand Down Expand Up @@ -1197,7 +1198,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)

static struct net_device_stats *elmc_get_stats(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
struct priv *p = netdev_priv(dev);
unsigned short crc, aln, rsc, ovrn;

crc = p->scb->crc_errs; /* get error-statistic from the ni82586 */
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ static int vortex_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);

if (dev && dev->priv) {
if (dev && netdev_priv(dev)) {
if (netif_running(dev)) {
netif_device_detach(dev);
vortex_down(dev, 1);
Expand Down Expand Up @@ -3214,7 +3214,7 @@ static void __exit vortex_eisa_cleanup(void)
#endif

if (compaq_net_device) {
vp = compaq_net_device->priv;
vp = netdev_priv(compaq_net_device);
ioaddr = ioport_map(compaq_net_device->base_addr,
VORTEX_TOTAL_SIZE);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,

SET_NETDEV_DEV(dev, &pdev->dev);

ap = dev->priv;
ap = netdev_priv(dev);
ap->pdev = pdev;
ap->name = pci_name(pdev);

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/appletalk/ipddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static struct net_device * __init ipddp_init(void)
*/
static struct net_device_stats *ipddp_get_stats(struct net_device *dev)
{
return dev->priv;
return netdev_priv(dev);
}

/*
Expand Down Expand Up @@ -170,8 +170,8 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)

skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */

((struct net_device_stats *) dev->priv)->tx_packets++;
((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len;
((struct net_device_stats *) netdev_priv(dev))->tx_packets++;
((struct net_device_stats *) netdev_priv(dev))->tx_bytes += skb->len;

if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
dev_kfree_skb(skb);
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/net/appletalk/ltpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@ static int sendup_buffer (struct net_device *dev)
int dnode, snode, llaptype, len;
int sklen;
struct sk_buff *skb;
struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats;
struct ltpc_private *ltpc_priv = netdev_priv(dev);
struct net_device_stats *stats = &ltpc_priv->stats;
struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf;

if (ltc->command != LT_RCVLAP) {
Expand Down Expand Up @@ -822,7 +823,8 @@ static int ltpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct sockaddr_at *sa = (struct sockaddr_at *) &ifr->ifr_addr;
/* we'll keep the localtalk node address in dev->pa_addr */
struct atalk_addr *aa = &((struct ltpc_private *)dev->priv)->my_addr;
struct ltpc_private *ltpc_priv = netdev_priv(dev);
struct atalk_addr *aa = &ltpc_priv->my_addr;
struct lt_init c;
int ltflags;

Expand Down Expand Up @@ -903,7 +905,8 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
* and skb->len is the length of the ddp data + ddp header
*/

struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats;
struct ltpc_private *ltpc_priv = netdev_priv(dev);
struct net_device_stats *stats = &ltpc_priv->stats;

int i;
struct lt_sendlap cbuf;
Expand Down Expand Up @@ -942,7 +945,8 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)

static struct net_device_stats *ltpc_get_stats(struct net_device *dev)
{
struct net_device_stats *stats = &((struct ltpc_private *) dev->priv)->stats;
struct ltpc_private *ltpc_priv = netdev_priv(dev);
struct net_device_stats *stats = &ltpc_priv->stats;
return stats;
}

Expand Down
Loading

0 comments on commit 99eae3f

Please sign in to comment.