diff options
Diffstat (limited to 'net/802/psnap.c')
-rw-r--r-- | net/802/psnap.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/802/psnap.c b/net/802/psnap.c index 70980baeb682..6fea0750662b 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c | |||
@@ -29,7 +29,7 @@ static struct llc_sap *snap_sap; | |||
29 | /* | 29 | /* |
30 | * Find a snap client by matching the 5 bytes. | 30 | * Find a snap client by matching the 5 bytes. |
31 | */ | 31 | */ |
32 | static struct datalink_proto *find_snap_client(unsigned char *desc) | 32 | static struct datalink_proto *find_snap_client(const unsigned char *desc) |
33 | { | 33 | { |
34 | struct datalink_proto *proto = NULL, *p; | 34 | struct datalink_proto *proto = NULL, *p; |
35 | 35 | ||
@@ -51,7 +51,7 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev, | |||
51 | int rc = 1; | 51 | int rc = 1; |
52 | struct datalink_proto *proto; | 52 | struct datalink_proto *proto; |
53 | static struct packet_type snap_packet_type = { | 53 | static struct packet_type snap_packet_type = { |
54 | .type = __constant_htons(ETH_P_SNAP), | 54 | .type = cpu_to_be16(ETH_P_SNAP), |
55 | }; | 55 | }; |
56 | 56 | ||
57 | if (unlikely(!pskb_may_pull(skb, 5))) | 57 | if (unlikely(!pskb_may_pull(skb, 5))) |
@@ -95,15 +95,16 @@ static int snap_request(struct datalink_proto *dl, | |||
95 | EXPORT_SYMBOL(register_snap_client); | 95 | EXPORT_SYMBOL(register_snap_client); |
96 | EXPORT_SYMBOL(unregister_snap_client); | 96 | EXPORT_SYMBOL(unregister_snap_client); |
97 | 97 | ||
98 | static char snap_err_msg[] __initdata = | 98 | static const char snap_err_msg[] __initconst = |
99 | KERN_CRIT "SNAP - unable to register with 802.2\n"; | 99 | KERN_CRIT "SNAP - unable to register with 802.2\n"; |
100 | 100 | ||
101 | static int __init snap_init(void) | 101 | static int __init snap_init(void) |
102 | { | 102 | { |
103 | snap_sap = llc_sap_open(0xAA, snap_rcv); | 103 | snap_sap = llc_sap_open(0xAA, snap_rcv); |
104 | 104 | if (!snap_sap) { | |
105 | if (!snap_sap) | ||
106 | printk(snap_err_msg); | 105 | printk(snap_err_msg); |
106 | return -EBUSY; | ||
107 | } | ||
107 | 108 | ||
108 | return 0; | 109 | return 0; |
109 | } | 110 | } |
@@ -121,7 +122,7 @@ module_exit(snap_exit); | |||
121 | /* | 122 | /* |
122 | * Register SNAP clients. We don't yet use this for IP. | 123 | * Register SNAP clients. We don't yet use this for IP. |
123 | */ | 124 | */ |
124 | struct datalink_proto *register_snap_client(unsigned char *desc, | 125 | struct datalink_proto *register_snap_client(const unsigned char *desc, |
125 | int (*rcvfunc)(struct sk_buff *, | 126 | int (*rcvfunc)(struct sk_buff *, |
126 | struct net_device *, | 127 | struct net_device *, |
127 | struct packet_type *, | 128 | struct packet_type *, |
@@ -136,7 +137,7 @@ struct datalink_proto *register_snap_client(unsigned char *desc, | |||
136 | 137 | ||
137 | proto = kmalloc(sizeof(*proto), GFP_ATOMIC); | 138 | proto = kmalloc(sizeof(*proto), GFP_ATOMIC); |
138 | if (proto) { | 139 | if (proto) { |
139 | memcpy(proto->type, desc,5); | 140 | memcpy(proto->type, desc, 5); |
140 | proto->rcvfunc = rcvfunc; | 141 | proto->rcvfunc = rcvfunc; |
141 | proto->header_length = 5 + 3; /* snap + 802.2 */ | 142 | proto->header_length = 5 + 3; /* snap + 802.2 */ |
142 | proto->request = snap_request; | 143 | proto->request = snap_request; |