Commit 85059e1e authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] netdev_priv() in arlan

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
parent abd36fc1
...@@ -129,7 +129,7 @@ static inline long us2ticks(int us) ...@@ -129,7 +129,7 @@ static inline long us2ticks(int us)
static inline int arlan_drop_tx(struct net_device *dev) static inline int arlan_drop_tx(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
priv->stats.tx_errors++; priv->stats.tx_errors++;
if (priv->Conf->tx_delay_ms) if (priv->Conf->tx_delay_ms)
...@@ -152,7 +152,7 @@ static inline int arlan_drop_tx(struct net_device *dev) ...@@ -152,7 +152,7 @@ static inline int arlan_drop_tx(struct net_device *dev)
int arlan_command(struct net_device *dev, int command_p) int arlan_command(struct net_device *dev, int command_p)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
int udelayed = 0; int udelayed = 0;
...@@ -481,7 +481,7 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -481,7 +481,7 @@ int arlan_command(struct net_device *dev, int command_p)
static inline void arlan_command_process(struct net_device *dev) static inline void arlan_command_process(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
int times = 0; int times = 0;
while (priv->waiting_command_mask && times < 8) while (priv->waiting_command_mask && times < 8)
...@@ -502,7 +502,7 @@ static inline void arlan_command_process(struct net_device *dev) ...@@ -502,7 +502,7 @@ static inline void arlan_command_process(struct net_device *dev)
static inline void arlan_retransmit_now(struct net_device *dev) static inline void arlan_retransmit_now(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); ARLAN_DEBUG_ENTRY("arlan_retransmit_now");
...@@ -540,7 +540,7 @@ static inline void arlan_retransmit_now(struct net_device *dev) ...@@ -540,7 +540,7 @@ static inline void arlan_retransmit_now(struct net_device *dev)
static void arlan_registration_timer(unsigned long data) static void arlan_registration_timer(unsigned long data)
{ {
struct net_device *dev = (struct net_device *) data; struct net_device *dev = (struct net_device *) data;
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
int bh_mark_needed = 0; int bh_mark_needed = 0;
int next_tick = 1; int next_tick = 1;
long lostTime = ((long)jiffies - (long)priv->registrationLastSeen) long lostTime = ((long)jiffies - (long)priv->registrationLastSeen)
...@@ -633,7 +633,7 @@ static void arlan_registration_timer(unsigned long data) ...@@ -633,7 +633,7 @@ static void arlan_registration_timer(unsigned long data)
static void arlan_print_registers(struct net_device *dev, int line) static void arlan_print_registers(struct net_device *dev, int line)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage,
...@@ -663,7 +663,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -663,7 +663,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
{ {
int i; int i;
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -764,7 +764,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -764,7 +764,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
static int arlan_hw_config(struct net_device *dev) static int arlan_hw_config(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -847,7 +847,7 @@ static int arlan_hw_config(struct net_device *dev) ...@@ -847,7 +847,7 @@ static int arlan_hw_config(struct net_device *dev)
static int arlan_read_card_configuration(struct net_device *dev) static int arlan_read_card_configuration(struct net_device *dev)
{ {
u_char tlx415; u_char tlx415;
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -1000,7 +1000,7 @@ static int __init arlan_check_fingerprint(unsigned long memaddr) ...@@ -1000,7 +1000,7 @@ static int __init arlan_check_fingerprint(unsigned long memaddr)
static int arlan_change_mtu(struct net_device *dev, int new_mtu) static int arlan_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
ARLAN_DEBUG_ENTRY("arlan_change_mtu"); ARLAN_DEBUG_ENTRY("arlan_change_mtu");
...@@ -1040,7 +1040,7 @@ static int arlan_mac_addr(struct net_device *dev, void *p) ...@@ -1040,7 +1040,7 @@ static int arlan_mac_addr(struct net_device *dev, void *p)
static int __init arlan_setup_device(struct net_device *dev, int num) static int __init arlan_setup_device(struct net_device *dev, int num)
{ {
struct arlan_private *ap = dev->priv; struct arlan_private *ap = netdev_priv(dev);
int err; int err;
ARLAN_DEBUG_ENTRY("arlan_setup_device"); ARLAN_DEBUG_ENTRY("arlan_setup_device");
...@@ -1081,7 +1081,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num) ...@@ -1081,7 +1081,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num)
static int __init arlan_probe_here(struct net_device *dev, static int __init arlan_probe_here(struct net_device *dev,
unsigned long memaddr) unsigned long memaddr)
{ {
struct arlan_private *ap = dev->priv; struct arlan_private *ap = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("arlan_probe_here"); ARLAN_DEBUG_ENTRY("arlan_probe_here");
...@@ -1110,7 +1110,7 @@ static int __init arlan_probe_here(struct net_device *dev, ...@@ -1110,7 +1110,7 @@ static int __init arlan_probe_here(struct net_device *dev,
static int arlan_open(struct net_device *dev) static int arlan_open(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
int ret = 0; int ret = 0;
...@@ -1208,7 +1208,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1208,7 +1208,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
static inline int DoNotReTransmitCrap(struct net_device *dev) static inline int DoNotReTransmitCrap(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize)
return 1; return 1;
...@@ -1218,7 +1218,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev) ...@@ -1218,7 +1218,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev)
static inline int DoNotWaitReTransmitCrap(struct net_device *dev) static inline int DoNotWaitReTransmitCrap(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize)
return 1; return 1;
...@@ -1227,7 +1227,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev) ...@@ -1227,7 +1227,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev)
static inline void arlan_queue_retransmit(struct net_device *dev) static inline void arlan_queue_retransmit(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); ARLAN_DEBUG_ENTRY("arlan_queue_retransmit");
...@@ -1242,7 +1242,7 @@ static inline void arlan_queue_retransmit(struct net_device *dev) ...@@ -1242,7 +1242,7 @@ static inline void arlan_queue_retransmit(struct net_device *dev)
static inline void RetryOrFail(struct net_device *dev) static inline void RetryOrFail(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("RetryOrFail"); ARLAN_DEBUG_ENTRY("RetryOrFail");
...@@ -1263,7 +1263,7 @@ static inline void RetryOrFail(struct net_device *dev) ...@@ -1263,7 +1263,7 @@ static inline void RetryOrFail(struct net_device *dev)
static void arlan_tx_done_interrupt(struct net_device *dev, int status) static void arlan_tx_done_interrupt(struct net_device *dev, int status)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt");
...@@ -1405,7 +1405,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short ...@@ -1405,7 +1405,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
char *skbtmp; char *skbtmp;
int i = 0; int i = 0;
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -1557,7 +1557,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short ...@@ -1557,7 +1557,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
static void arlan_process_interrupt(struct net_device *dev) static void arlan_process_interrupt(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
u_char rxStatus = READSHMB(arlan->rxStatus); u_char rxStatus = READSHMB(arlan->rxStatus);
u_char txStatus = READSHMB(arlan->txStatus); u_char txStatus = READSHMB(arlan->txStatus);
...@@ -1660,7 +1660,7 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1660,7 +1660,7 @@ static void arlan_process_interrupt(struct net_device *dev)
static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
u_char rxStatus = READSHMB(arlan->rxStatus); u_char rxStatus = READSHMB(arlan->rxStatus);
u_char txStatus = READSHMB(arlan->txStatus); u_char txStatus = READSHMB(arlan->txStatus);
...@@ -1683,7 +1683,7 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1683,7 +1683,7 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static int arlan_close(struct net_device *dev) static int arlan_close(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
ARLAN_DEBUG_ENTRY("arlan_close"); ARLAN_DEBUG_ENTRY("arlan_close");
...@@ -1717,7 +1717,7 @@ static long alignLong(volatile u_char * ptr) ...@@ -1717,7 +1717,7 @@ static long alignLong(volatile u_char * ptr)
static struct net_device_stats *arlan_statistics(struct net_device *dev) static struct net_device_stats *arlan_statistics(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
...@@ -1747,7 +1747,7 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev) ...@@ -1747,7 +1747,7 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev)
static void arlan_set_multicast(struct net_device *dev) static void arlan_set_multicast(struct net_device *dev)
{ {
struct arlan_private *priv = dev->priv; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
int board_conf_needed = 0; int board_conf_needed = 0;
......
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
static const char *arlan_diagnostic_info_string(struct net_device *dev) static const char *arlan_diagnostic_info_string(struct net_device *dev)
{ {
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card;
u_char diagnosticInfo; u_char diagnosticInfo;
READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char); READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char);
...@@ -113,7 +114,8 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev) ...@@ -113,7 +114,8 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev)
static const char *arlan_hardware_type_string(struct net_device *dev) static const char *arlan_hardware_type_string(struct net_device *dev)
{ {
u_char hardwareType; u_char hardwareType;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card;
READSHM(hardwareType, arlan->hardwareType, u_char); READSHM(hardwareType, arlan->hardwareType, u_char);
switch (hardwareType) switch (hardwareType)
...@@ -189,7 +191,8 @@ static void arlan_print_diagnostic_info(struct net_device *dev) ...@@ -189,7 +191,8 @@ static void arlan_print_diagnostic_info(struct net_device *dev)
u_char diagnosticInfo; u_char diagnosticInfo;
u_short diagnosticOffset; u_short diagnosticOffset;
u_char hardwareType; u_char hardwareType;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card;
// ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info"); // ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info");
...@@ -254,7 +257,8 @@ static int arlan_hw_test_memory(struct net_device *dev) ...@@ -254,7 +257,8 @@ static int arlan_hw_test_memory(struct net_device *dev)
int i; int i;
int memlen = sizeof(struct arlan_shmem) - 0xF; /* avoid control register */ int memlen = sizeof(struct arlan_shmem) - 0xF; /* avoid control register */
volatile char *arlan_mem = (char *) (dev->mem_start); volatile char *arlan_mem = (char *) (dev->mem_start);
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card;
char pattern; char pattern;
ptr = NULL; ptr = NULL;
...@@ -319,7 +323,8 @@ static int arlan_hw_test_memory(struct net_device *dev) ...@@ -319,7 +323,8 @@ static int arlan_hw_test_memory(struct net_device *dev)
static int arlan_setup_card_by_book(struct net_device *dev) static int arlan_setup_card_by_book(struct net_device *dev)
{ {
u_char irqLevel, configuredStatusFlag; u_char irqLevel, configuredStatusFlag;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem *arlan = priv->card;
// ARLAN_DEBUG_ENTRY("arlan_setup_card"); // ARLAN_DEBUG_ENTRY("arlan_setup_card");
......
...@@ -403,14 +403,14 @@ struct arlan_private { ...@@ -403,14 +403,14 @@ struct arlan_private {
#define ARLAN_COM_INT 0x80 #define ARLAN_COM_INT 0x80
#define TXLAST(dev) (((struct arlan_private *)dev->priv)->txRing[((struct arlan_private *)dev->priv)->txLast]) #define TXLAST(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[((struct arlan_private *)netdev_priv(dev))->txLast])
#define TXHEAD(dev) (((struct arlan_private *)dev->priv)->txRing[0]) #define TXHEAD(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[0])
#define TXTAIL(dev) (((struct arlan_private *)dev->priv)->txRing[1]) #define TXTAIL(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[1])
#define TXBuffStart(dev) \ #define TXBuffStart(dev) \
((int)(((struct arlan_private *)dev->priv)->card)->txBuffer) - ((int)(((struct arlan_private *)dev->priv)->card) ) ((int)(((struct arlan_private *)netdev_priv(dev))->card)->txBuffer) - ((int)(((struct arlan_private *)netdev_priv(dev))->card) )
#define TXBuffEnd(dev) \ #define TXBuffEnd(dev) \
((int)(((struct arlan_private *)dev->priv)->card)->rxBuffer) - ((int)(((struct arlan_private *)dev->priv)->card) ((int)(((struct arlan_private *)netdev_priv(dev))->card)->rxBuffer) - ((int)(((struct arlan_private *)netdev_priv(dev))->card)
#define READSHM(to,from,atype) {\ #define READSHM(to,from,atype) {\
atype tmp;\ atype tmp;\
...@@ -451,16 +451,16 @@ struct arlan_private { ...@@ -451,16 +451,16 @@ struct arlan_private {
#define registrationBad(dev)\ #define registrationBad(dev)\
( ( READSHMB(((struct arlan_private *)dev->priv)->card->registrationMode) > 0) && \ ( ( READSHMB(((struct arlan_private *)netdev_priv(dev))->card->registrationMode) > 0) && \
( READSHMB(((struct arlan_private *)dev->priv)->card->registrationStatus) == 0) ) ( READSHMB(((struct arlan_private *)netdev_priv(dev))->card->registrationStatus) == 0) )
#define readControlRegister(dev)\ #define readControlRegister(dev)\
READSHMB(((struct arlan_private *)dev->priv)->card->cntrlRegImage) READSHMB(((struct arlan_private *)netdev_priv(dev))->card->cntrlRegImage)
#define writeControlRegister(dev, v){\ #define writeControlRegister(dev, v){\
WRITESHMB(((struct arlan_private *)dev->priv)->card->cntrlRegImage ,((v) &0xF) );\ WRITESHMB(((struct arlan_private *)netdev_priv(dev))->card->cntrlRegImage ,((v) &0xF) );\
WRITESHMB(((struct arlan_private *)dev->priv)->card->controlRegister ,(v) );} WRITESHMB(((struct arlan_private *)netdev_priv(dev))->card->controlRegister ,(v) );}
#define arlan_interrupt_lancpu(dev) {\ #define arlan_interrupt_lancpu(dev) {\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment