X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=net%2F802%2Ffc.c;h=cb3475ea6fdada58337e7bf6e39773478afb0b7b;hb=22c7fdf4a7acfa24d9d498b1357e6c07d0e6c553;hp=282c4ab1abe60836c79cccb39173cf2cbc918f92;hpb=f5c7f03113fc9c547012cf403aec4b534d575ef0;p=linux-2.6 diff --git a/net/802/fc.c b/net/802/fc.c index 282c4ab1ab..cb3475ea6f 100644 --- a/net/802/fc.c +++ b/net/802/fc.c @@ -1,6 +1,6 @@ /* * NET3: Fibre Channel device handling subroutines - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -10,12 +10,10 @@ * v 1.0 03/22/99 */ -#include #include #include #include #include -#include #include #include #include @@ -32,18 +30,18 @@ #include /* - * Put the headers on a Fibre Channel packet. + * Put the headers on a Fibre Channel packet. */ - + static int fc_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, - void *daddr, void *saddr, unsigned len) + const void *daddr, const void *saddr, unsigned len) { struct fch_hdr *fch; int hdr_len; - /* - * Add the 802.2 SNAP header if IP as the IPv4 code calls + /* + * Add the 802.2 SNAP header if IP as the IPv4 code calls * dev->hard_header directly. */ if (type == ETH_P_IP || type == ETH_P_ARP) @@ -61,7 +59,7 @@ static int fc_header(struct sk_buff *skb, struct net_device *dev, else { hdr_len = sizeof(struct fch_hdr); - fch = (struct fch_hdr *)skb_push(skb, hdr_len); + fch = (struct fch_hdr *)skb_push(skb, hdr_len); } if(saddr) @@ -69,20 +67,20 @@ static int fc_header(struct sk_buff *skb, struct net_device *dev, else memcpy(fch->saddr,dev->dev_addr,dev->addr_len); - if(daddr) + if(daddr) { memcpy(fch->daddr,daddr,dev->addr_len); return(hdr_len); } return -hdr_len; } - + /* * A neighbour discovery of some species (eg arp) has completed. We * can now send the packet. */ - -static int fc_rebuild_header(struct sk_buff *skb) + +static int fc_rebuild_header(struct sk_buff *skb) { struct fch_hdr *fch=(struct fch_hdr *)skb->data; struct fcllc *fcllc=(struct fcllc *)(skb->data+sizeof(struct fch_hdr)); @@ -97,11 +95,14 @@ static int fc_rebuild_header(struct sk_buff *skb) #endif } +static const struct header_ops fc_header_ops = { + .create = fc_header, + .rebuild = fc_rebuild_header, +}; + static void fc_setup(struct net_device *dev) { - dev->hard_header = fc_header; - dev->rebuild_header = fc_rebuild_header; - + dev->header_ops = &fc_header_ops; dev->type = ARPHRD_IEEE802; dev->hard_header_len = FC_HLEN; dev->mtu = 2024;