Skip to content

Commit

Permalink
arcnet: convert to net_device_ops
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 21, 2009
1 parent 5803c51 commit bca5b89
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
33 changes: 16 additions & 17 deletions drivers/net/arcnet/arcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ EXPORT_SYMBOL(arcnet_unregister_proto);
EXPORT_SYMBOL(arcnet_debug);
EXPORT_SYMBOL(alloc_arcdev);
EXPORT_SYMBOL(arcnet_interrupt);
EXPORT_SYMBOL(arcnet_open);
EXPORT_SYMBOL(arcnet_close);
EXPORT_SYMBOL(arcnet_send_packet);
EXPORT_SYMBOL(arcnet_timeout);

/* Internal function prototypes */
static int arcnet_open(struct net_device *dev);
static int arcnet_close(struct net_device *dev);
static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
static void arcnet_timeout(struct net_device *dev);
static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len);
Expand Down Expand Up @@ -321,11 +321,18 @@ static const struct header_ops arcnet_header_ops = {
.rebuild = arcnet_rebuild_header,
};

static const struct net_device_ops arcnet_netdev_ops = {
.ndo_open = arcnet_open,
.ndo_stop = arcnet_close,
.ndo_start_xmit = arcnet_send_packet,
.ndo_tx_timeout = arcnet_timeout,
};

/* Setup a struct device for ARCnet. */
static void arcdev_setup(struct net_device *dev)
{
dev->type = ARPHRD_ARCNET;
dev->netdev_ops = &arcnet_netdev_ops;
dev->header_ops = &arcnet_header_ops;
dev->hard_header_len = sizeof(struct archdr);
dev->mtu = choose_mtu();
Expand All @@ -338,17 +345,9 @@ static void arcdev_setup(struct net_device *dev)
/* New-style flags. */
dev->flags = IFF_BROADCAST;

/*
* Put in this stuff here, so we don't have to export the symbols to
* the chipset drivers.
*/
dev->open = arcnet_open;
dev->stop = arcnet_close;
dev->hard_start_xmit = arcnet_send_packet;
dev->tx_timeout = arcnet_timeout;
}

struct net_device *alloc_arcdev(char *name)
struct net_device *alloc_arcdev(const char *name)
{
struct net_device *dev;

Expand All @@ -370,7 +369,7 @@ struct net_device *alloc_arcdev(char *name)
* that "should" only need to be set once at boot, so that there is
* non-reboot way to recover if something goes wrong.
*/
static int arcnet_open(struct net_device *dev)
int arcnet_open(struct net_device *dev)
{
struct arcnet_local *lp = netdev_priv(dev);
int count, newmtu, error;
Expand Down Expand Up @@ -470,7 +469,7 @@ static int arcnet_open(struct net_device *dev)


/* The inverse routine to arcnet_open - shuts down the card. */
static int arcnet_close(struct net_device *dev)
int arcnet_close(struct net_device *dev)
{
struct arcnet_local *lp = netdev_priv(dev);

Expand Down Expand Up @@ -599,7 +598,7 @@ static int arcnet_rebuild_header(struct sk_buff *skb)


/* Called by the kernel in order to transmit a packet. */
static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
{
struct arcnet_local *lp = netdev_priv(dev);
struct archdr *pkt;
Expand Down Expand Up @@ -718,7 +717,7 @@ static int go_tx(struct net_device *dev)


/* Called by the kernel when transmit times out */
static void arcnet_timeout(struct net_device *dev)
void arcnet_timeout(struct net_device *dev)
{
unsigned long flags;
struct arcnet_local *lp = netdev_priv(dev);
Expand Down
7 changes: 6 additions & 1 deletion include/linux/arcdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc);

void arcnet_unregister_proto(struct ArcProto *proto);
irqreturn_t arcnet_interrupt(int irq, void *dev_id);
struct net_device *alloc_arcdev(char *name);
struct net_device *alloc_arcdev(const char *name);

int arcnet_open(struct net_device *dev);
int arcnet_close(struct net_device *dev);
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
void arcnet_timeout(struct net_device *dev);

#endif /* __KERNEL__ */
#endif /* _LINUX_ARCDEVICE_H */

0 comments on commit bca5b89

Please sign in to comment.