Commit 5a4a60ae authored by David S. Miller's avatar David S. Miller

Merge bk://kernel.bkbits.net/acme/net-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents d29e0365 41d0ff2e
......@@ -70,9 +70,9 @@ MODULE_PARM_DESC(cycx_debug, "cyclomx debug level");
/* Function Prototypes */
/* WAN link driver entry points */
static int setup (wan_device_t *wandev, wandev_conf_t *conf);
static int shutdown (wan_device_t *wandev);
static int ioctl (wan_device_t *wandev, unsigned cmd, unsigned long arg);
static int setup(struct wan_device *wandev, wandev_conf_t *conf);
static int shutdown(struct wan_device *wandev);
static int ioctl(struct wan_device *wandev, unsigned cmd, unsigned long arg);
/* Miscellaneous functions */
static irqreturn_t cycx_isr (int irq, void *dev_id, struct pt_regs *regs);
......@@ -122,7 +122,7 @@ int __init cyclomx_init (void)
/* Register adapters with WAN router */
for (cnt = 0; cnt < ncards; ++cnt) {
cycx_t *card = &card_array[cnt];
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
sprintf(card->devname, "%s%d", drvname, cnt + 1);
wandev->magic = ROUTER_MAGIC;
......@@ -181,7 +181,7 @@ static void __exit cyclomx_cleanup (void)
* configuration structure is in kernel memory (including extended data, if
* any).
*/
static int setup (wan_device_t *wandev, wandev_conf_t *conf)
static int setup(struct wan_device *wandev, wandev_conf_t *conf)
{
int err = -EFAULT;
cycx_t *card;
......@@ -273,7 +273,7 @@ out: return err;
* This function is called by the router when device is being unregistered or
* when it handles ROUTER_DOWN IOCTL.
*/
static int shutdown (wan_device_t *wandev)
static int shutdown(struct wan_device *wandev)
{
int ret = -EFAULT;
cycx_t *card;
......@@ -305,7 +305,7 @@ out: return ret;
*
* no reserved ioctls for the cyclom 2x up to now
*/
static int ioctl (wan_device_t *wandev, unsigned cmd, unsigned long arg)
static int ioctl(struct wan_device *wandev, unsigned cmd, unsigned long arg)
{
return -EINVAL;
}
......
......@@ -120,10 +120,10 @@ typedef struct x25_channel {
/* Function Prototypes */
/* WAN link driver entry points. These are called by the WAN router module. */
static int update (wan_device_t *wandev),
new_if (wan_device_t *wandev, struct net_device *dev,
wanif_conf_t *conf),
del_if (wan_device_t *wandev, struct net_device *dev);
static int update(struct wan_device *wandev),
new_if(struct wan_device *wandev, struct net_device *dev,
wanif_conf_t *conf),
del_if(struct wan_device *wandev, struct net_device *dev);
/* Network device interface */
static int if_init (struct net_device *dev),
......@@ -175,14 +175,15 @@ static u8 log2 (u32 n);
static unsigned dec_to_uint (u8 *str, int len);
static struct net_device *get_dev_by_lcn (wan_device_t *wandev, s16 lcn);
static struct net_device *get_dev_by_dte_addr (wan_device_t *wandev, char *dte);
static struct net_device *get_dev_by_lcn(struct wan_device *wandev, s16 lcn);
static struct net_device *get_dev_by_dte_addr(struct wan_device *wandev,
char *dte);
#ifdef CYCLOMX_X25_DEBUG
static void hex_dump(char *msg, unsigned char *p, int len);
static void x25_dump_config(TX25Config *conf);
static void x25_dump_stats(TX25Stats *stats);
static void x25_dump_devs(wan_device_t *wandev);
static void x25_dump_devs(struct wan_device *wandev);
#else
#define hex_dump(msg, p, len)
#define x25_dump_config(conf)
......@@ -318,7 +319,7 @@ int cyx_init (cycx_t *card, wandev_conf_t *conf)
/* WAN Device Driver Entry Points */
/* Update device status & statistics. */
static int update (wan_device_t *wandev)
static int update(struct wan_device *wandev)
{
/* sanity checks */
if (!wandev || !wandev->private)
......@@ -342,8 +343,8 @@ static int update (wan_device_t *wandev)
*
* Return: 0 o.k.
* < 0 failure (channel will not be created) */
static int new_if (wan_device_t *wandev, struct net_device *dev,
wanif_conf_t *conf)
static int new_if(struct wan_device *wandev, struct net_device *dev,
wanif_conf_t *conf)
{
cycx_t *card = wandev->private;
x25_channel_t *chan;
......@@ -431,7 +432,7 @@ static int new_if (wan_device_t *wandev, struct net_device *dev,
}
/* Delete logical channel. */
static int del_if (wan_device_t *wandev, struct net_device *dev)
static int del_if(struct wan_device *wandev, struct net_device *dev)
{
if (dev->priv) {
x25_channel_t *chan = dev->priv;
......@@ -461,7 +462,7 @@ static int if_init (struct net_device *dev)
{
x25_channel_t *chan = dev->priv;
cycx_t *card = chan->card;
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
/* Initialize device driver entry points */
dev->open = if_open;
......@@ -711,7 +712,7 @@ static void cyx_isr (cycx_t *card)
static void tx_intr (cycx_t *card, TX25Cmd *cmd)
{
struct net_device *dev;
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
u8 lcn;
cycx_peek(&card->hw, cmd->buf, &lcn, sizeof(lcn));
......@@ -741,7 +742,7 @@ static void tx_intr (cycx_t *card, TX25Cmd *cmd)
* socket buffers available) the whole packet sequence must be discarded. */
static void rx_intr (cycx_t *card, TX25Cmd *cmd)
{
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
struct net_device *dev;
x25_channel_t *chan;
struct sk_buff *skb;
......@@ -825,7 +826,7 @@ static void rx_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect interrupt handler. */
static void connect_intr (cycx_t *card, TX25Cmd *cmd)
{
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
struct net_device *dev = NULL;
x25_channel_t *chan;
u8 d[32],
......@@ -867,7 +868,7 @@ static void connect_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect confirm interrupt handler. */
static void connect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
{
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
struct net_device *dev;
x25_channel_t *chan;
u8 lcn, key;
......@@ -894,7 +895,7 @@ static void connect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* Disconnect confirm interrupt handler. */
static void disconnect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
{
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
struct net_device *dev;
u8 lcn;
......@@ -914,7 +915,7 @@ static void disconnect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* disconnect interrupt handler. */
static void disconnect_intr (cycx_t *card, TX25Cmd *cmd)
{
wan_device_t *wandev = &card->wandev;
struct wan_device *wandev = &card->wandev;
struct net_device *dev;
u8 lcn;
......@@ -1255,7 +1256,7 @@ static int x25_send (cycx_t *card, u8 link, u8 lcn, u8 bitm, int len, void *buf)
/* Miscellaneous */
/* Find network device by its channel number. */
static struct net_device *get_dev_by_lcn (wan_device_t *wandev, s16 lcn)
static struct net_device *get_dev_by_lcn(struct wan_device *wandev, s16 lcn)
{
struct net_device *dev = wandev->dev;
x25_channel_t *chan;
......@@ -1271,7 +1272,8 @@ static struct net_device *get_dev_by_lcn (wan_device_t *wandev, s16 lcn)
}
/* Find network device by its remote dte address. */
static struct net_device *get_dev_by_dte_addr (wan_device_t *wandev, char *dte)
static struct net_device *get_dev_by_dte_addr(struct wan_device *wandev,
char *dte)
{
struct net_device *dev = wandev->dev;
x25_channel_t *chan;
......@@ -1556,7 +1558,7 @@ static void x25_dump_stats(TX25Stats *stats)
printk(KERN_INFO "rx_aborts=%d\n", stats->rx_aborts);
}
static void x25_dump_devs(wan_device_t *wandev)
static void x25_dump_devs(struct wan_device *wandev)
{
struct net_device *dev = wandev->dev;
......
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>
......@@ -184,9 +182,9 @@ int init_module (void);
void cleanup_module (void);
/* WAN link driver entry points */
static int setup (wan_device_t* wandev, wandev_conf_t* conf);
static int shutdown (wan_device_t* wandev);
static int ioctl (wan_device_t* wandev, unsigned cmd, unsigned long arg);
static int setup(struct wan_device* wandev, wandev_conf_t* conf);
static int shutdown(struct wan_device* wandev);
static int ioctl(struct wan_device* wandev, unsigned cmd, unsigned long arg);
/* IOCTL handlers */
static int ioctl_dump (sdla_t* card, sdla_dump_t* u_dump);
......@@ -279,7 +277,7 @@ int wanpipe_init(void)
/* Register adapters with WAN router */
for (cnt = 0; cnt < ncards; ++ cnt) {
sdla_t* card = &card_array[cnt];
wan_device_t* wandev = &card->wandev;
struct wan_device* wandev = &card->wandev;
card->next = NULL;
sprintf(card->devname, "%s%d", drvname, cnt + 1);
......@@ -352,7 +350,7 @@ void cleanup_module (void)
* any).
*/
static int setup (wan_device_t* wandev, wandev_conf_t* conf)
static int setup(struct wan_device* wandev, wandev_conf_t* conf)
{
sdla_t* card;
int err = 0;
......@@ -779,7 +777,7 @@ static int check_s514_conflicts(sdla_t* card,wandev_conf_t* conf, int *irq)
* This function is called by the router when device is being unregistered or
* when it handles ROUTER_DOWN IOCTL.
*/
static int shutdown (wan_device_t* wandev)
static int shutdown(struct wan_device* wandev)
{
sdla_t *card;
int err=0;
......@@ -888,7 +886,7 @@ static void release_hw (sdla_t *card)
* This function is called when router handles one of the reserved user
* IOCTLs. Note that 'arg' stil points to user address space.
*/
static int ioctl (wan_device_t* wandev, unsigned cmd, unsigned long arg)
static int ioctl(struct wan_device* wandev, unsigned cmd, unsigned long arg)
{
sdla_t* card;
int err;
......@@ -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;
......
......@@ -130,19 +130,19 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static int update (wan_device_t* wandev);
static int new_if (wan_device_t* wandev, netdevice_t* dev,
wanif_conf_t* conf);
static int del_if (wan_device_t* wandev, netdevice_t* dev);
static int update(struct wan_device* wandev);
static int new_if(struct wan_device* wandev, struct net_device* dev,
wanif_conf_t* conf);
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,
chdlc_private_area_t* chdlc_priv_area);
static int process_udp_mgmt_pkt(sdla_t* card, 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, 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;
......@@ -456,10 +456,10 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
* as to minimize the time that we are inside the interrupt handler.
*
*/
static int update (wan_device_t* wandev)
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,11 +522,12 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* < 0 failure (channel will not be created)
*/
static int new_if (wan_device_t* wandev, netdevice_t* pdev, wanif_conf_t* conf)
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;
......@@ -616,7 +617,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* pdev, wanif_conf_t* conf)
/*============================================================================
* Delete logical channel.
*/
static int del_if (wan_device_t* 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;
......@@ -651,11 +652,11 @@ static int del_if (wan_device_t* 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;
wan_device_t* wandev = &card->wandev;
struct wan_device* wandev = &card->wandev;
/* NOTE: Most of the dev initialization was
* done in sppp_attach(), called by new_if()
......@@ -694,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;
......@@ -719,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;
......@@ -752,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;
......@@ -783,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;
......@@ -973,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;
......@@ -1242,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;
......@@ -1355,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;
......@@ -1477,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;
......@@ -1665,8 +1666,8 @@ 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,
chdlc_private_area_t* chdlc_priv_area )
struct sk_buff *skb, struct net_device* dev,
chdlc_private_area_t* chdlc_priv_area )
{
int udp_pkt_stored = 0;
......@@ -1692,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;
......@@ -2076,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;
......@@ -2213,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)
......@@ -2284,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){
......@@ -2330,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;
......
......@@ -46,7 +46,7 @@
typedef struct cycx {
char devname[WAN_DRVNAME_SZ+1]; /* card name */
cycxhw_t hw; /* hardware configuration */
wan_device_t wandev; /* WAN device data space */
struct wan_device wandev; /* WAN device data space */
u32 open_cnt; /* number of open interfaces */
u32 state_tick; /* link state timestamp */
spinlock_t lock;
......
......@@ -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 */
......@@ -286,7 +284,7 @@ typedef struct sdla
{
char devname[WAN_DRVNAME_SZ+1]; /* card name */
sdlahw_t hw; /* hardware configuration */
wan_device_t wandev; /* WAN device data space */
struct wan_device wandev; /* WAN device data space */
unsigned open_cnt; /* number of open interfaces */
unsigned long state_tick; /* link state timestamp */
......@@ -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
......@@ -462,8 +460,7 @@ typedef struct wanif_conf
/*----------------------------------------------------------------------------
* WAN device data space.
*/
typedef struct wan_device
{
struct wan_device {
unsigned magic; /* magic number */
char* name; /* -> WAN device name (ASCIIZ) */
void* private; /* -> driver private data */
......@@ -506,27 +503,29 @@ typedef 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,
wanif_conf_t *conf);
int (*del_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, 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 */
} wan_device_t;
};
/* Public functions available for device drivers */
extern int register_wan_device(wan_device_t *wandev);
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);
extern void wanrouter_proc_cleanup(void);
extern int wanrouter_proc_add(wan_device_t *wandev);
extern int wanrouter_proc_delete(wan_device_t *wandev);
extern int wanrouter_proc_add(struct wan_device *wandev);
extern int wanrouter_proc_delete(struct wan_device *wandev);
extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
extern void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
......@@ -535,7 +534,7 @@ extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
/* Public Data */
extern wan_device_t *router_devlist; /* list of registered devices */
extern struct wan_device *router_devlist; /* list of registered devices */
#endif /* __KERNEL__ */
#endif /* _ROUTER_H */
This diff is collapsed.
......@@ -127,18 +127,18 @@ static void dbg_kfree(void * v, int line) {
* WAN device IOCTL handlers
*/
static int device_setup(wan_device_t *wandev, wandev_conf_t *u_conf);
static int device_stat(wan_device_t *wandev, wandev_stat_t *u_stat);
static int device_shutdown(wan_device_t *wandev);
static int device_new_if(wan_device_t *wandev, wanif_conf_t *u_conf);
static int device_del_if(wan_device_t *wandev, char *u_name);
static int device_setup(struct wan_device *wandev, wandev_conf_t *u_conf);
static int device_stat(struct wan_device *wandev, wandev_stat_t *u_stat);
static int device_shutdown(struct wan_device *wandev);
static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf);
static int device_del_if(struct wan_device *wandev, char *u_name);
/*
* Miscellaneous
*/
static wan_device_t *find_device (char *name);
static int delete_interface (wan_device_t *wandev, char *name);
static struct wan_device *find_device (char *name);
static int delete_interface (struct wan_device *wandev, char *name);
void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
......@@ -148,11 +148,11 @@ void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
* Global Data
*/
static char fullname[] = "Sangoma WANPIPE Router";
static char copyright[] = "(c) 1995-2000 Sangoma Technologies Inc.";
static char modname[] = ROUTER_NAME; /* short module name */
wan_device_t* router_devlist = NULL; /* list of registered devices */
static int devcnt = 0;
static char fullname[] = "Sangoma WANPIPE Router";
static char copyright[] = "(c) 1995-2000 Sangoma Technologies Inc.";
static char modname[] = ROUTER_NAME; /* short module name */
struct wan_device* router_devlist; /* list of registered devices */
static int devcnt;
/*
* Organize Unique Identifiers for encapsulation/decapsulation
......@@ -262,7 +262,7 @@ void cleanup_module (void)
*/
int register_wan_device(wan_device_t *wandev)
int register_wan_device(struct wan_device *wandev)
{
int err, namelen;
......@@ -322,7 +322,7 @@ int register_wan_device(wan_device_t *wandev)
int unregister_wan_device(char *name)
{
wan_device_t *wandev, *prev;
struct wan_device *wandev, *prev;
if (name == NULL)
return -EINVAL;
......@@ -363,8 +363,8 @@ int unregister_wan_device(char *name)
*/
int wanrouter_encapsulate (struct sk_buff *skb, netdevice_t *dev,
unsigned short type)
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;
......@@ -457,7 +457,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
{
int err = 0;
struct proc_dir_entry *dent;
wan_device_t *wandev;
struct wan_device *wandev;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
......@@ -519,7 +519,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
* o call driver's setup() entry point
*/
static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
static int device_setup(struct wan_device *wandev, wandev_conf_t *u_conf)
{
void *data = NULL;
wandev_conf_t *conf;
......@@ -595,9 +595,9 @@ static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
* o call driver's shutdown() entry point
*/
static int device_shutdown (wan_device_t *wandev)
static int device_shutdown(struct wan_device *wandev)
{
netdevice_t *dev;
struct net_device *dev;
int err=0;
if (wandev->state == WAN_UNCONFIGURED)
......@@ -628,7 +628,7 @@ static int device_shutdown (wan_device_t *wandev)
* Get WAN device status & statistics.
*/
static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
static int device_stat(struct wan_device *wandev, wandev_stat_t *u_stat)
{
wandev_stat_t stat;
......@@ -658,10 +658,10 @@ static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
* o register network interface
*/
static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
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 (wan_device_t *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 (wan_device_t *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 (wan_device_t *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 (wan_device_t *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;
......@@ -774,7 +775,7 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
* o copy configuration data to kernel address space
*/
static int device_del_if (wan_device_t *wandev, char *u_name)
static int device_del_if(struct wan_device *wandev, char *u_name)
{
char name[WAN_IFNAME_SZ + 1];
int err = 0;
......@@ -815,9 +816,9 @@ static int device_del_if (wan_device_t *wandev, char *u_name)
* Return pointer to the WAN device data space or NULL if device not found.
*/
static wan_device_t *find_device(char *name)
static struct wan_device *find_device(char *name)
{
wan_device_t *wandev;
struct wan_device *wandev;
for (wandev = router_devlist;wandev && strcmp(wandev->name, name);
wandev = wandev->next);
......@@ -841,16 +842,16 @@ static wan_device_t *find_device(char *name)
* sure that opened interfaces are not removed!
*/
static int delete_interface (wan_device_t *wandev, 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 (wan_device_t *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;
......
......@@ -96,7 +96,7 @@ static struct proc_dir_entry *proc_router;
*/
static void *r_start(struct seq_file *m, loff_t *pos)
{
wan_device_t *wandev;
struct wan_device *wandev;
loff_t l = *pos;
lock_kernel();
......@@ -108,7 +108,7 @@ static void *r_start(struct seq_file *m, loff_t *pos)
}
static void *r_next(struct seq_file *m, void *v, loff_t *pos)
{
wan_device_t *wandev = v;
struct wan_device *wandev = v;
(*pos)++;
return (v == (void *)1) ? router_devlist : wandev->next;
}
......@@ -119,7 +119,7 @@ static void r_stop(struct seq_file *m, void *v)
static int config_show(struct seq_file *m, void *v)
{
wan_device_t *p = v;
struct wan_device *p = v;
if (v == (void *)1) {
seq_puts(m, "Device name | port |IRQ|DMA| mem.addr |");
seq_puts(m, "mem.size|option1|option2|option3|option4\n");
......@@ -135,7 +135,7 @@ static int config_show(struct seq_file *m, void *v)
static int status_show(struct seq_file *m, void *v)
{
wan_device_t *p = v;
struct wan_device *p = v;
if (v == (void *)1) {
seq_puts(m, "Device name |protocol|station|interface|");
seq_puts(m, "clocking|baud rate| MTU |ndev|link state\n");
......@@ -221,7 +221,7 @@ static struct file_operations status_fops =
static int wandev_show(struct seq_file *m, void *v)
{
wan_device_t *wandev = v;
struct wan_device *wandev = v;
if (wandev->magic != ROUTER_MAGIC)
return 0;
......@@ -339,7 +339,7 @@ void wanrouter_proc_cleanup (void)
* Add directory entry for WAN device.
*/
int wanrouter_proc_add (wan_device_t* wandev)
int wanrouter_proc_add(struct wan_device* wandev)
{
if (wandev->magic != ROUTER_MAGIC)
return -EINVAL;
......@@ -356,7 +356,7 @@ int wanrouter_proc_add (wan_device_t* wandev)
* Delete directory entry for WAN device.
*/
int wanrouter_proc_delete(wan_device_t* wandev)
int wanrouter_proc_delete(struct wan_device* wandev)
{
if (wandev->magic != ROUTER_MAGIC)
return -EINVAL;
......@@ -379,12 +379,12 @@ void wanrouter_proc_cleanup(void)
{
}
int wanrouter_proc_add(wan_device_t *wandev)
int wanrouter_proc_add(struct wan_device *wandev)
{
return 0;
}
int wanrouter_proc_delete(wan_device_t *wandev)
int wanrouter_proc_delete(struct wan_device *wandev)
{
return 0;
}
......
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