Skip to content

Commit bca5b89

Browse files
Stephen Hemmingerdavem330
authored andcommitted
arcnet: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5803c51 commit bca5b89

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

‎drivers/net/arcnet/arcnet.c‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ EXPORT_SYMBOL(arcnet_unregister_proto);
9595
EXPORT_SYMBOL(arcnet_debug);
9696
EXPORT_SYMBOL(alloc_arcdev);
9797
EXPORT_SYMBOL(arcnet_interrupt);
98+
EXPORT_SYMBOL(arcnet_open);
99+
EXPORT_SYMBOL(arcnet_close);
100+
EXPORT_SYMBOL(arcnet_send_packet);
101+
EXPORT_SYMBOL(arcnet_timeout);
98102

99103
/* Internal function prototypes */
100-
static int arcnet_open(struct net_device *dev);
101-
static int arcnet_close(struct net_device *dev);
102-
static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
103-
static void arcnet_timeout(struct net_device *dev);
104104
static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
105105
unsigned short type, const void *daddr,
106106
const void *saddr, unsigned len);
@@ -321,11 +321,18 @@ static const struct header_ops arcnet_header_ops = {
321321
.rebuild = arcnet_rebuild_header,
322322
};
323323

324+
static const struct net_device_ops arcnet_netdev_ops = {
325+
.ndo_open = arcnet_open,
326+
.ndo_stop = arcnet_close,
327+
.ndo_start_xmit = arcnet_send_packet,
328+
.ndo_tx_timeout = arcnet_timeout,
329+
};
324330

325331
/* Setup a struct device for ARCnet. */
326332
static void arcdev_setup(struct net_device *dev)
327333
{
328334
dev->type = ARPHRD_ARCNET;
335+
dev->netdev_ops = &arcnet_netdev_ops;
329336
dev->header_ops = &arcnet_header_ops;
330337
dev->hard_header_len = sizeof(struct archdr);
331338
dev->mtu = choose_mtu();
@@ -338,17 +345,9 @@ static void arcdev_setup(struct net_device *dev)
338345
/* New-style flags. */
339346
dev->flags = IFF_BROADCAST;
340347

341-
/*
342-
* Put in this stuff here, so we don't have to export the symbols to
343-
* the chipset drivers.
344-
*/
345-
dev->open = arcnet_open;
346-
dev->stop = arcnet_close;
347-
dev->hard_start_xmit = arcnet_send_packet;
348-
dev->tx_timeout = arcnet_timeout;
349348
}
350349

351-
struct net_device *alloc_arcdev(char *name)
350+
struct net_device *alloc_arcdev(const char *name)
352351
{
353352
struct net_device *dev;
354353

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

471470

472471
/* The inverse routine to arcnet_open - shuts down the card. */
473-
static int arcnet_close(struct net_device *dev)
472+
int arcnet_close(struct net_device *dev)
474473
{
475474
struct arcnet_local *lp = netdev_priv(dev);
476475

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

600599

601600
/* Called by the kernel in order to transmit a packet. */
602-
static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
601+
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
603602
{
604603
struct arcnet_local *lp = netdev_priv(dev);
605604
struct archdr *pkt;
@@ -718,7 +717,7 @@ static int go_tx(struct net_device *dev)
718717

719718

720719
/* Called by the kernel when transmit times out */
721-
static void arcnet_timeout(struct net_device *dev)
720+
void arcnet_timeout(struct net_device *dev)
722721
{
723722
unsigned long flags;
724723
struct arcnet_local *lp = netdev_priv(dev);

‎include/linux/arcdevice.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc);
333333

334334
void arcnet_unregister_proto(struct ArcProto *proto);
335335
irqreturn_t arcnet_interrupt(int irq, void *dev_id);
336-
struct net_device *alloc_arcdev(char *name);
336+
struct net_device *alloc_arcdev(const char *name);
337+
338+
int arcnet_open(struct net_device *dev);
339+
int arcnet_close(struct net_device *dev);
340+
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
341+
void arcnet_timeout(struct net_device *dev);
337342

338343
#endif /* __KERNEL__ */
339344
#endif /* _LINUX_ARCDEVICE_H */

0 commit comments

Comments
 (0)