From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: [PATCH] wanrouter: don't use typedefs for wan_device, just struct wan_device Date: Thu, 15 May 2003 17:29:14 -0300 Sender: netdev-bounce@oss.sgi.com Message-ID: <20030515202914.GF11319@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux Networking Development Mailing List Return-path: To: "David S. Miller" Content-Disposition: inline Errors-to: netdev-bounce@oss.sgi.com List-Id: netdev.vger.kernel.org David, Please consider pulling from: bk://kernel.bkbits.net/acme/net-2.5 Next one is to kill the obnoxious netdevice_t 8) Then, to fix the MOD_{INC,DEC}_USE_COUNT stuff. - Arnaldo You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.1144, 2003-05-15 17:17:01-03:00, acme@conectiva.com.br o wanrouter: don't use typedefs for wan_device, just struct wan_device drivers/net/wan/cycx_main.c | 14 +++++------ drivers/net/wan/cycx_x25.c | 44 +++++++++++++++++++----------------- drivers/net/wan/sdla_chdlc.c | 13 +++++----- drivers/net/wan/sdla_fr.c | 16 +++++++------ drivers/net/wan/sdla_ppp.c | 16 +++++++------ drivers/net/wan/sdla_x25.c | 25 ++++++++++---------- drivers/net/wan/sdlamain.c | 14 +++++------ drivers/net/wan/wanpipe_multppp.c | 15 ++++++------ include/linux/cyclomx.h | 2 - include/linux/wanpipe.h | 2 - include/linux/wanrouter.h | 13 ++++------ net/wanrouter/wanmain.c | 46 +++++++++++++++++++------------------- net/wanrouter/wanproc.c | 18 +++++++------- 13 files changed, 123 insertions(+), 115 deletions(-) diff -Nru a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c --- a/drivers/net/wan/cycx_main.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/cycx_main.c Thu May 15 17:24:14 2003 @@ -70,9 +70,9 @@ /* 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 @@ /* 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 @@ * 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 @@ * 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 @@ * * 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; } diff -Nru a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c --- a/drivers/net/wan/cycx_x25.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/cycx_x25.c Thu May 15 17:24:14 2003 @@ -120,10 +120,10 @@ /* 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 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 @@ /* 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 @@ * * 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 @@ } /* 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 @@ { 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 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 @@ * 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ } /* 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 @@ 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; diff -Nru a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c --- a/drivers/net/wan/sdla_chdlc.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/sdla_chdlc.c Thu May 15 17:24:14 2003 @@ -186,8 +186,8 @@ /****** 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, +static int update(struct wan_device* wandev); +static int new_if(struct wan_device* wandev, netdevice_t* dev, wanif_conf_t* conf); /* Network device interface */ @@ -598,7 +598,7 @@ * 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; @@ -666,7 +666,8 @@ * Return: 0 o.k. * < 0 failure (channel will not be created) */ -static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf) +static int new_if(struct wan_device* wandev, netdevice_t* dev, + wanif_conf_t* conf) { sdla_t* card = wandev->private; chdlc_private_area_t* chdlc_priv_area; @@ -898,10 +899,10 @@ * registration. */ static int if_init (netdevice_t* 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; /* Initialize device driver entry points */ dev->open = &if_open; diff -Nru a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c --- a/drivers/net/wan/sdla_fr.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/sdla_fr.c Thu May 15 17:24:14 2003 @@ -323,9 +323,10 @@ /****** 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, netdevice_t *dev, + wanif_conf_t *conf); +static int del_if(struct wan_device *wandev, netdevice_t *dev); static void disable_comm (sdla_t *card); /* WANPIPE-specific entry points */ @@ -746,7 +747,7 @@ /*============================================================================ * Update device status & statistics. */ -static int update (wan_device_t* wandev) +static int update(struct wan_device* wandev) { volatile sdla_t* card; unsigned long timeout; @@ -791,7 +792,8 @@ * Return: 0 o.k. * < 0 failure (channel will not be created) */ -static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf) +static int new_if(struct wan_device* wandev, netdevice_t* dev, + wanif_conf_t* conf) { sdla_t* card = wandev->private; fr_channel_t* chan; @@ -1020,7 +1022,7 @@ /*============================================================================ * Delete logical channel. */ -static int del_if (wan_device_t* wandev, netdevice_t* dev) +static int del_if(struct wan_device* wandev, netdevice_t* dev) { fr_channel_t* chan = dev->priv; unsigned long smp_flags=0; @@ -1120,7 +1122,7 @@ { fr_channel_t* chan = dev->priv; sdla_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; diff -Nru a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c --- a/drivers/net/wan/sdla_ppp.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/sdla_ppp.c Thu May 15 17:24:14 2003 @@ -231,9 +231,10 @@ /****** 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, netdevice_t *dev, + wanif_conf_t *conf); +static int del_if(struct wan_device *wandev, netdevice_t *dev); /* WANPIPE-specific entry points */ static int wpp_exec (struct sdla *card, void *u_cmd, void *u_data); @@ -444,7 +445,7 @@ /*============================================================================ * Update device status & statistics. */ -static int update(wan_device_t *wandev) +static int update(struct wan_device *wandev) { sdla_t* card = wandev->private; netdevice_t* dev; @@ -504,7 +505,8 @@ * Return: 0 o.k. * < 0 failure (channel will not be created) */ -static int new_if(wan_device_t *wandev, netdevice_t *dev, wanif_conf_t *conf) +static int new_if(struct wan_device *wandev, netdevice_t *dev, + wanif_conf_t *conf) { sdla_t *card = wandev->private; ppp_private_area_t *ppp_priv_area; @@ -622,7 +624,7 @@ /*============================================================================ * Delete logical channel. */ -static int del_if(wan_device_t *wandev, netdevice_t *dev) +static int del_if(struct wan_device *wandev, netdevice_t *dev) { return 0; } @@ -685,7 +687,7 @@ { ppp_private_area_t *ppp_priv_area = dev->priv; sdla_t *card = ppp_priv_area->card; - wan_device_t *wandev = &card->wandev; + struct wan_device *wandev = &card->wandev; /* Initialize device driver entry points */ dev->open = &if_open; diff -Nru a/drivers/net/wan/sdla_x25.c b/drivers/net/wan/sdla_x25.c --- a/drivers/net/wan/sdla_x25.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/sdla_x25.c Thu May 15 17:24:14 2003 @@ -330,10 +330,10 @@ * 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, netdevice_t* dev, + wanif_conf_t* conf); +static int del_if(struct wan_device* wandev, netdevice_t* dev); static void disable_comm (sdla_t* card); static void disable_comm_shutdown(sdla_t *card); @@ -425,7 +425,7 @@ */ static int connect (sdla_t* card); static int disconnect (sdla_t* card); -static netdevice_t* get_dev_by_lcn(wan_device_t* wandev, unsigned lcn); +static netdevice_t* get_dev_by_lcn(struct wan_device* wandev, unsigned lcn); static int chan_connect (netdevice_t* dev); static int chan_disc (netdevice_t* dev); static void set_chan_state (netdevice_t* dev, int state); @@ -830,7 +830,7 @@ * <0 Failed (or busy). */ -static int update (wan_device_t* wandev) +static int update(struct wan_device* wandev) { volatile sdla_t* card; TX25Status* status; @@ -895,7 +895,8 @@ * Return: 0 Ok * <0 Failed (channel will not be created) */ -static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf) +static int new_if(struct wan_device* wandev, netdevice_t* dev, + wanif_conf_t* conf) { sdla_t* card = wandev->private; x25_channel_t* chan; @@ -1029,7 +1030,7 @@ //FIXME Del IF Should be taken out now. -static int del_if (wan_device_t* wandev, netdevice_t* dev) +static int del_if(struct wan_device* wandev, netdevice_t* dev) { return 0; } @@ -1099,7 +1100,7 @@ { x25_channel_t* chan = dev->priv; sdla_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; @@ -3101,7 +3102,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb) { - wan_device_t* wandev = &card->wandev; + struct wan_device* wandev = &card->wandev; int new_lcn = mb->cmd.lcn; netdevice_t* dev = get_dev_by_lcn(wandev, new_lcn); x25_channel_t* chan = NULL; @@ -3336,7 +3337,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb) { - wan_device_t* wandev = &card->wandev; + struct wan_device* wandev = &card->wandev; netdevice_t* dev; x25_channel_t *chan; unsigned char old_state; @@ -3447,7 +3448,7 @@ * Find network device by its channel number. */ -static netdevice_t* get_dev_by_lcn (wan_device_t* wandev, unsigned lcn) +static netdevice_t* get_dev_by_lcn(struct wan_device* wandev, unsigned lcn) { netdevice_t* dev; diff -Nru a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c --- a/drivers/net/wan/sdlamain.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/sdlamain.c Thu May 15 17:24:14 2003 @@ -184,9 +184,9 @@ 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 +279,7 @@ /* 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 +352,7 @@ * 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 +779,7 @@ * 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 +888,7 @@ * 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; diff -Nru a/drivers/net/wan/wanpipe_multppp.c b/drivers/net/wan/wanpipe_multppp.c --- a/drivers/net/wan/wanpipe_multppp.c Thu May 15 17:24:14 2003 +++ b/drivers/net/wan/wanpipe_multppp.c Thu May 15 17:24:14 2003 @@ -130,10 +130,10 @@ /****** 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, +static int update(struct wan_device* wandev); +static int new_if(struct wan_device* wandev, netdevice_t* dev, wanif_conf_t* conf); -static int del_if (wan_device_t* wandev, netdevice_t* dev); +static int del_if(struct wan_device* wandev, netdevice_t* dev); /* Network device interface */ static int if_init (netdevice_t* dev); @@ -456,7 +456,7 @@ * 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; @@ -522,7 +522,8 @@ * 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, netdevice_t* pdev, + wanif_conf_t* conf) { struct ppp_device *pppdev = (struct ppp_device *)pdev; @@ -616,7 +617,7 @@ /*============================================================================ * Delete logical channel. */ -static int del_if (wan_device_t* wandev, netdevice_t* dev) +static int del_if(struct wan_device* wandev, netdevice_t* dev) { chdlc_private_area_t *chdlc_priv_area = dev->priv; sdla_t *card = chdlc_priv_area->card; @@ -655,7 +656,7 @@ { 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() diff -Nru a/include/linux/cyclomx.h b/include/linux/cyclomx.h --- a/include/linux/cyclomx.h Thu May 15 17:24:14 2003 +++ b/include/linux/cyclomx.h Thu May 15 17:24:14 2003 @@ -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; diff -Nru a/include/linux/wanpipe.h b/include/linux/wanpipe.h --- a/include/linux/wanpipe.h Thu May 15 17:24:14 2003 +++ b/include/linux/wanpipe.h Thu May 15 17:24:14 2003 @@ -286,7 +286,7 @@ { 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 */ diff -Nru a/include/linux/wanrouter.h b/include/linux/wanrouter.h --- a/include/linux/wanrouter.h Thu May 15 17:24:14 2003 +++ b/include/linux/wanrouter.h Thu May 15 17:24:14 2003 @@ -462,8 +462,7 @@ /*---------------------------------------------------------------------------- * 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 */ @@ -514,10 +513,10 @@ netdevice_t* 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); @@ -525,8 +524,8 @@ /* 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 @@ /* 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 */ diff -Nru a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c --- a/net/wanrouter/wanmain.c Thu May 15 17:24:14 2003 +++ b/net/wanrouter/wanmain.c Thu May 15 17:24:14 2003 @@ -127,18 +127,18 @@ * 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 @@ * 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 @@ */ -int register_wan_device(wan_device_t *wandev) +int register_wan_device(struct wan_device *wandev) { int err, namelen; @@ -322,7 +322,7 @@ int unregister_wan_device(char *name) { - wan_device_t *wandev, *prev; + struct wan_device *wandev, *prev; if (name == NULL) return -EINVAL; @@ -457,7 +457,7 @@ { 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 @@ * 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,7 +595,7 @@ * 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; int err=0; @@ -628,7 +628,7 @@ * 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,7 +658,7 @@ * 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; @@ -774,7 +774,7 @@ * 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 +815,9 @@ * 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,7 +841,7 @@ * 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; unsigned long smp_flags=0; diff -Nru a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c --- a/net/wanrouter/wanproc.c Thu May 15 17:24:14 2003 +++ b/net/wanrouter/wanproc.c Thu May 15 17:24:14 2003 @@ -96,7 +96,7 @@ */ 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_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 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 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 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 @@ * 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 @@ * 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 @@ { } -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; } =================================================================== This BitKeeper patch contains the following changesets: 1.1144 ## Wrapped with gzip_uu ## M'XL( &[WPSX ]U3C]2+)+_F5W9-/R6I]<\&NQ/:;_,LRN;EX_^:O'_[Q^KWCW-Z2'^_#Q5WR2Y*3VULG MSU:?PEF\?A7F][-L<96OPL5ZGN3FGL5V:,$IY?"?8IZ@RBV82Z571"QF+)0L MB2F7OBN=\.-R_BJ>WB79\728QQ3,XU(54E+&G1%A5XQ)2:BXINJ:*<*\&_A+ MV245-Y02O1NO#G>!_(4)0@7JVR3PUF0.%O\.2>;=6+V M,$[2-4FSE1XQCI-/TRCYCOQ[L\[).E]MHKSRO?-W(H1@TGFWVVOGTO*/X]"0 M.M]W/"0(P/5VR?IJ'DX75U'UD0,5%"[W65"$W/-]-V6Q8B*A(JK?WS:>Y@PY MA3-3!>>^KSH7.%U$LTV<7,^FB\UGS6PY7297]WL+E P6R'Q9!!,O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