o wanrouter: kill netdevice_t, do as all the rest of the tree, use struct net_device

parent 7a2d9c10
This diff is collapsed.
This diff is collapsed.
......@@ -70,7 +70,7 @@
typedef struct chdlc_private_area
{
netdevice_t *slave;
struct net_device *slave;
sdla_t *card;
int TracingEnabled; /* For enabling Tracing */
unsigned long curr_trace_addr; /* Used for Tracing */
......
This diff is collapsed.
This diff is collapsed.
......@@ -64,8 +64,6 @@
#include <linux/sdlapci.h>
#include <linux/if_wanpipe_common.h>
#define netdevice_t struct net_device
#include <asm/uaccess.h> /* kernel <-> user copy */
#include <linux/inetdevice.h>
......@@ -1255,7 +1253,7 @@ void wanpipe_mark_bh (void)
}
}
void wakeup_sk_bh (netdevice_t *dev)
void wakeup_sk_bh(struct net_device *dev)
{
wanpipe_common_t *chan = dev->priv;
......@@ -1268,7 +1266,7 @@ void wakeup_sk_bh (netdevice_t *dev)
}
}
int change_dev_flags (netdevice_t *dev, unsigned flags)
int change_dev_flags(struct net_device *dev, unsigned flags)
{
struct ifreq if_info;
mm_segment_t fs = get_fs();
......@@ -1285,7 +1283,7 @@ int change_dev_flags (netdevice_t *dev, unsigned flags)
return err;
}
unsigned long get_ip_address (netdevice_t *dev, int option)
unsigned long get_ip_address(struct net_device *dev, int option)
{
struct in_ifaddr *ifaddr;
......@@ -1323,7 +1321,7 @@ unsigned long get_ip_address (netdevice_t *dev, int option)
return 0;
}
void add_gateway(sdla_t *card, netdevice_t *dev)
void add_gateway(sdla_t *card, struct net_device *dev)
{
mm_segment_t oldfs;
struct rtentry route;
......
......@@ -131,18 +131,18 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static int update(struct wan_device* wandev);
static int new_if(struct wan_device* wandev, netdevice_t* dev,
static int new_if(struct wan_device* wandev, struct net_device* dev,
wanif_conf_t* conf);
static int del_if(struct wan_device* wandev, netdevice_t* dev);
static int del_if(struct wan_device* wandev, struct net_device* dev);
/* Network device interface */
static int if_init (netdevice_t* dev);
static int if_open (netdevice_t* dev);
static int if_close (netdevice_t* dev);
static int if_send (struct sk_buff* skb, netdevice_t* dev);
static struct net_device_stats* if_stats (netdevice_t* dev);
static int if_init(struct net_device* dev);
static int if_open(struct net_device* dev);
static int if_close(struct net_device* dev);
static int if_send(struct sk_buff* skb, struct net_device* dev);
static struct net_device_stats* if_stats(struct net_device* dev);
static void if_tx_timeout (netdevice_t *dev);
static void if_tx_timeout(struct net_device *dev);
/* CHDLC Firmware interface functions */
static int chdlc_configure (sdla_t* card, void* data);
......@@ -158,7 +158,7 @@ static int config_chdlc (sdla_t *card);
/* Miscellaneous CHDLC Functions */
static int set_chdlc_config (sdla_t* card);
static void init_chdlc_tx_rx_buff( sdla_t* card, netdevice_t *dev );
static void init_chdlc_tx_rx_buff(sdla_t* card, struct net_device *dev);
static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb);
static int process_chdlc_exception(sdla_t *card);
static int process_global_exception(sdla_t *card);
......@@ -176,14 +176,14 @@ static int reply_udp( unsigned char *data, unsigned int mbox_len );
static int intr_test( sdla_t* card);
static int udp_pkt_type( struct sk_buff *skb , sdla_t* card);
static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
struct sk_buff *skb, netdevice_t* dev,
struct sk_buff *skb, struct net_device* dev,
chdlc_private_area_t* chdlc_priv_area);
static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
static int process_udp_mgmt_pkt(sdla_t* card, struct net_device* dev,
chdlc_private_area_t* chdlc_priv_area);
static unsigned short calc_checksum (char *, int);
static void s508_lock (sdla_t *card, unsigned long *smp_flags);
static void s508_unlock (sdla_t *card, unsigned long *smp_flags);
static void send_ppp_term_request (netdevice_t*);
static void send_ppp_term_request(struct net_device *dev);
static int Intr_test_counter;
......@@ -459,7 +459,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
static int update(struct wan_device* wandev)
{
sdla_t* card = wandev->private;
netdevice_t* dev;
struct net_device* dev;
volatile chdlc_private_area_t* chdlc_priv_area;
SHARED_MEMORY_INFO_STRUCT *flags;
unsigned long timeout;
......@@ -522,12 +522,12 @@ static int update(struct wan_device* wandev)
* Return: 0 o.k.
* < 0 failure (channel will not be created)
*/
static int new_if(struct wan_device* wandev, netdevice_t* pdev,
static int new_if(struct wan_device* wandev, struct net_device* pdev,
wanif_conf_t* conf)
{
struct ppp_device *pppdev = (struct ppp_device *)pdev;
netdevice_t *dev=NULL;
struct net_device *dev = NULL;
struct sppp *sp;
sdla_t* card = wandev->private;
chdlc_private_area_t* chdlc_priv_area;
......@@ -617,7 +617,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* pdev,
/*============================================================================
* Delete logical channel.
*/
static int del_if(struct wan_device* wandev, netdevice_t* dev)
static int del_if(struct wan_device* wandev, struct net_device* dev)
{
chdlc_private_area_t *chdlc_priv_area = dev->priv;
sdla_t *card = chdlc_priv_area->card;
......@@ -652,8 +652,8 @@ static int del_if(struct wan_device* wandev, netdevice_t* dev)
* interface registration. Returning anything but zero will fail interface
* registration.
*/
static int if_init (netdevice_t* dev)
{
static int if_init(struct net_device* dev)
{
chdlc_private_area_t* chdlc_priv_area = dev->priv;
sdla_t* card = chdlc_priv_area->card;
struct wan_device* wandev = &card->wandev;
......@@ -695,7 +695,7 @@ static int if_init (netdevice_t* dev)
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static void if_tx_timeout (netdevice_t *dev)
static void if_tx_timeout(struct net_device *dev)
{
chdlc_private_area_t* chan = dev->priv;
sdla_t *card = chan->card;
......@@ -720,7 +720,7 @@ static void if_tx_timeout (netdevice_t *dev)
*
* Return 0 if O.k. or errno.
*/
static int if_open (netdevice_t* dev)
static int if_open(struct net_device* dev)
{
chdlc_private_area_t* chdlc_priv_area = dev->priv;
sdla_t* card = chdlc_priv_area->card;
......@@ -753,7 +753,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last close, then disable communications and interrupts.
* o reset flags.
*/
static int if_close (netdevice_t* dev)
static int if_close(struct net_device* dev)
{
chdlc_private_area_t* chdlc_priv_area = dev->priv;
sdla_t* card = chdlc_priv_area->card;
......@@ -784,7 +784,7 @@ static int if_close (netdevice_t* dev)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
*/
static int if_send (struct sk_buff* skb, netdevice_t* dev)
static int if_send(struct sk_buff* skb, struct net_device* dev)
{
chdlc_private_area_t *chdlc_priv_area = dev->priv;
sdla_t *card = chdlc_priv_area->card;
......@@ -974,7 +974,7 @@ unsigned short calc_checksum (char *data, int len)
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_statistics.
*/
static struct net_device_stats* if_stats (netdevice_t* dev)
static struct net_device_stats* if_stats(struct net_device* dev)
{
sdla_t *my_card;
chdlc_private_area_t* chdlc_priv_area;
......@@ -1243,7 +1243,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
*/
STATIC void wsppp_isr (sdla_t* card)
{
netdevice_t* dev;
struct net_device* dev;
SHARED_MEMORY_INFO_STRUCT* flags = NULL;
int i;
sdla_t *my_card;
......@@ -1356,7 +1356,7 @@ STATIC void wsppp_isr (sdla_t* card)
*/
static void rx_intr (sdla_t* card)
{
netdevice_t *dev;
struct net_device *dev;
chdlc_private_area_t *chdlc_priv_area;
SHARED_MEMORY_INFO_STRUCT *flags = card->u.c.flags;
CHDLC_DATA_RX_STATUS_EL_STRUCT *rxbuf = card->u.c.rxmb;
......@@ -1478,7 +1478,7 @@ static void rx_intr (sdla_t* card)
*/
void timer_intr(sdla_t *card)
{
netdevice_t* dev;
struct net_device* dev;
chdlc_private_area_t* chdlc_priv_area = NULL;
SHARED_MEMORY_INFO_STRUCT* flags = NULL;
......@@ -1666,7 +1666,7 @@ static int process_chdlc_exception(sdla_t *card)
*/
static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
struct sk_buff *skb, netdevice_t* dev,
struct sk_buff *skb, struct net_device* dev,
chdlc_private_area_t* chdlc_priv_area )
{
int udp_pkt_stored = 0;
......@@ -1693,7 +1693,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
* Process UDP management packet.
*/
static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
static int process_udp_mgmt_pkt(sdla_t* card, struct net_device* dev,
chdlc_private_area_t* chdlc_priv_area )
{
unsigned char *buf;
......@@ -2077,7 +2077,7 @@ static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
* Initialize Receive and Transmit Buffers.
*/
static void init_chdlc_tx_rx_buff( sdla_t* card, netdevice_t *dev )
static void init_chdlc_tx_rx_buff(sdla_t* card, struct net_device *dev)
{
CHDLC_MAILBOX_STRUCT* mb = card->mbox;
CHDLC_TX_STATUS_EL_CFG_STRUCT *tx_config;
......@@ -2214,7 +2214,7 @@ static int udp_pkt_type(struct sk_buff *skb, sdla_t* card)
*/
static void port_set_state (sdla_t *card, int state)
{
netdevice_t *dev = card->wandev.dev;
struct net_device *dev = card->wandev.dev;
chdlc_private_area_t *chdlc_priv_area = dev->priv;
if (card->u.c.state != state)
......@@ -2285,7 +2285,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
static int config_chdlc (sdla_t *card)
{
netdevice_t *dev = card->wandev.dev;
struct net_device *dev = card->wandev.dev;
SHARED_MEMORY_INFO_STRUCT *flags = card->u.c.flags;
if (card->u.c.comm_enabled){
......@@ -2331,7 +2331,7 @@ static int config_chdlc (sdla_t *card)
}
static void send_ppp_term_request (netdevice_t *dev)
static void send_ppp_term_request(struct net_device *dev)
{
struct sk_buff *new_skb;
unsigned char *buf;
......
......@@ -101,16 +101,12 @@ typedef struct
#ifdef __KERNEL__
#ifndef netdevice_t
#define netdevice_t struct net_device
#endif
/* Private wanpipe socket structures. */
struct wanpipe_opt
{
void *mbox; /* Mail box */
void *card; /* Card bouded to */
netdevice_t *dev; /* Bounded device */
struct net_device *dev; /* Bounded device */
unsigned short lcn; /* Binded LCN */
unsigned char svc; /* 0=pvc, 1=svc */
unsigned char timer; /* flag for delayed transmit*/
......
......@@ -19,11 +19,8 @@
#include <linux/version.h>
#define netdevice_t struct net_device
typedef struct {
netdevice_t *slave;
struct net_device *slave;
atomic_t packet_sent;
atomic_t receive_block;
atomic_t command;
......@@ -32,8 +29,8 @@ typedef struct {
long common_critical;
struct timer_list *tx_timer;
struct sock *sk; /* Wanpipe Sock bind's here */
int (*func) (struct sk_buff *, netdevice_t *,
struct sock *);
int (*func)(struct sk_buff *skb, struct net_device *dev,
struct sock *sk);
struct work_struct wanpipe_work; /* deferred keventd work */
unsigned char rw_bind; /* Sock bind state */
......
......@@ -39,8 +39,6 @@
#ifndef _WANPIPE_H
#define _WANPIPE_H
#define netdevice_t struct net_device
#include <linux/wanrouter.h>
/* Defines */
......@@ -335,22 +333,22 @@ typedef struct sdla
u32 hi_pvc;
u32 lo_svc;
u32 hi_svc;
netdevice_t *svc_to_dev_map[MAX_X25_LCN];
netdevice_t *pvc_to_dev_map[MAX_X25_LCN];
netdevice_t *tx_dev;
netdevice_t *cmd_dev;
struct net_device *svc_to_dev_map[MAX_X25_LCN];
struct net_device *pvc_to_dev_map[MAX_X25_LCN];
struct net_device *tx_dev;
struct net_device *cmd_dev;
u32 no_dev;
volatile u8 *hdlc_buf_status;
u32 tx_interrupts_pending;
u16 timer_int_enabled;
netdevice_t *poll_device;
struct net_device *poll_device;
atomic_t command_busy;
u16 udp_pkt_lgth;
u32 udp_type;
u8 udp_pkt_src;
u32 udp_lcn;
netdevice_t * udp_dev;
struct net_device *udp_dev;
s8 udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT];
u8 LAPB_hdlc; /* Option to turn off X25 and run only LAPB */
......@@ -369,7 +367,7 @@ typedef struct sdla
unsigned rx_top; /* S508 receive buffer end */
unsigned short node_dlci[100];
unsigned short dlci_num;
netdevice_t *dlci_to_dev_map[991 + 1];
struct net_device *dlci_to_dev_map[991 + 1];
unsigned tx_interrupts_pending;
unsigned short timer_int_enabled;
unsigned short udp_pkt_lgth;
......@@ -382,7 +380,7 @@ typedef struct sdla
void *curr_trc_el; /* current trace element */
unsigned short trc_bfr_space; /* trace buffer space */
unsigned char update_comms_stats;
netdevice_t *arp_dev;
struct net_device *arp_dev;
spinlock_t if_send_lock;
} f;
struct /****** PPP-specific data ***********/
......@@ -483,10 +481,10 @@ extern sdla_t * wanpipe_find_card_num (int);
extern void wanpipe_queue_work (struct work_struct *);
extern void wanpipe_mark_bh (void);
extern void wakeup_sk_bh (netdevice_t *);
extern int change_dev_flags (netdevice_t *, unsigned);
extern unsigned long get_ip_address (netdevice_t *dev, int option);
extern void add_gateway(sdla_t *, netdevice_t *);
extern void wakeup_sk_bh(struct net_device *dev);
extern int change_dev_flags(struct net_device *dev, unsigned flags);
extern unsigned long get_ip_address(struct net_device *dev, int option);
extern void add_gateway(sdla_t *card, struct net_device *dev);
#endif /* __KERNEL__ */
......
......@@ -44,8 +44,6 @@
* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
*****************************************************************************/
#define netdevice_t struct net_device
#include <linux/spinlock.h> /* Support for SMP Locking */
#ifndef _ROUTER_H
......@@ -505,12 +503,12 @@ struct wan_device {
int (*update) (struct wan_device *wandev);
int (*ioctl) (struct wan_device *wandev, unsigned cmd,
unsigned long arg);
int (*new_if) (struct wan_device *wandev, netdevice_t *dev,
int (*new_if)(struct wan_device *wandev, struct net_device *dev,
wanif_conf_t *conf);
int (*del_if) (struct wan_device *wandev, netdevice_t *dev);
int (*del_if)(struct wan_device *wandev, struct net_device *dev);
/****** maintained by the router ****/
struct wan_device* next; /* -> next device */
netdevice_t* dev; /* list of network interfaces */
struct net_device* dev; /* list of network interfaces */
unsigned ndev; /* number of interfaces */
struct proc_dir_entry *dent; /* proc filesystem entry */
};
......@@ -518,8 +516,10 @@ struct wan_device {
/* Public functions available for device drivers */
extern int register_wan_device(struct wan_device *wandev);
extern int unregister_wan_device(char *name);
unsigned short wanrouter_type_trans(struct sk_buff *skb, netdevice_t *dev);
int wanrouter_encapsulate(struct sk_buff *skb, netdevice_t *dev,unsigned short type);
unsigned short wanrouter_type_trans(struct sk_buff *skb,
struct net_device *dev);
int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
unsigned short type);
/* Proc interface functions. These must not be called by the drivers! */
extern int wanrouter_proc_init(void);
......
This diff is collapsed.
......@@ -363,7 +363,7 @@ int unregister_wan_device(char *name)
*/
int wanrouter_encapsulate (struct sk_buff *skb, netdevice_t *dev,
int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
unsigned short type)
{
int hdr_len = 0;
......@@ -406,7 +406,7 @@ int wanrouter_encapsulate (struct sk_buff *skb, netdevice_t *dev,
*/
unsigned short wanrouter_type_trans (struct sk_buff *skb, netdevice_t *dev)
unsigned short wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev)
{
int cnt = skb->data[0] ? 0 : 1; /* there may be a pad present */
unsigned short ethertype;
......@@ -597,7 +597,7 @@ static int device_setup(struct wan_device *wandev, wandev_conf_t *u_conf)
static int device_shutdown(struct wan_device *wandev)
{
netdevice_t *dev;
struct net_device *dev;
int err=0;
if (wandev->state == WAN_UNCONFIGURED)
......@@ -661,7 +661,7 @@ static int device_stat(struct wan_device *wandev, wandev_stat_t *u_stat)
static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
{
wanif_conf_t conf;
netdevice_t *dev=NULL;
struct net_device *dev = NULL;
#ifdef CONFIG_WANPIPE_MULTPPP
struct ppp_device *pppdev=NULL;
#endif
......@@ -682,13 +682,14 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
if (pppdev == NULL)
return -ENOBUFS;
memset(pppdev, 0, sizeof(struct ppp_device));
pppdev->dev = kmalloc(sizeof(netdevice_t), GFP_KERNEL);
pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
if (pppdev->dev == NULL) {
kfree(pppdev);
return -ENOBUFS;
}
memset(pppdev->dev, 0, sizeof(netdevice_t));
err = wandev->new_if(wandev, (netdevice_t *)pppdev, &conf);
memset(pppdev->dev, 0, sizeof(struct net_device));
err = wandev->new_if(wandev,
(struct net_device *)pppdev, &conf);
dev = pppdev->dev;
#else
printk(KERN_INFO "%s: Wanpipe Mulit-Port PPP support has not been compiled in!\n",
......@@ -696,10 +697,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
return -EPROTONOSUPPORT;
#endif
} else {
dev = kmalloc(sizeof(netdevice_t), GFP_KERNEL);
dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
if (dev == NULL)
return -ENOBUFS;
memset(dev, 0, sizeof(netdevice_t));
memset(dev, 0, sizeof(struct net_device));
err = wandev->new_if(wandev, dev, &conf);
}
......@@ -722,7 +723,7 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
err = register_netdev(dev);
if (!err) {
netdevice_t *slave=NULL;
struct net_device *slave = NULL;
unsigned long smp_flags=0;
lock_adapter_irq(&wandev->lock, &smp_flags);
......@@ -731,10 +732,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
wandev->dev = dev;
} else {
for (slave=wandev->dev;
*((netdevice_t**)slave->priv);
slave=*((netdevice_t**)slave->priv));
*((struct net_device **)slave->priv);
slave = *((struct net_device **)slave->priv));
*((netdevice_t**)slave->priv) = dev;
*((struct net_device **)slave->priv) = dev;
}
++wandev->ndev;
......@@ -843,14 +844,14 @@ static struct wan_device *find_device(char *name)
static int delete_interface(struct wan_device *wandev, char *name)
{
netdevice_t *dev=NULL, *prev=NULL;
struct net_device *dev = NULL, *prev = NULL;
unsigned long smp_flags=0;
lock_adapter_irq(&wandev->lock, &smp_flags);
dev = wandev->dev;
prev = NULL;
while (dev && strcmp(name, dev->name)) {
netdevice_t **slave = dev->priv;
struct net_device **slave = dev->priv;
prev = dev;
dev = *slave;
}
......@@ -867,12 +868,12 @@ static int delete_interface(struct wan_device *wandev, char *name)
lock_adapter_irq(&wandev->lock, &smp_flags);
if (prev) {
netdevice_t **prev_slave = prev->priv;
netdevice_t **slave = dev->priv;
struct net_device **prev_slave = prev->priv;
struct net_device **slave = dev->priv;
*prev_slave = *slave;
} else {
netdevice_t **slave = dev->priv;
struct net_device **slave = dev->priv;
wandev->dev = *slave;
}
--wandev->ndev;
......
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