Thomas Gleixner | 2b27bdc | 2019-05-29 16:57:50 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 2 | /* |
| 3 | * File: pep-gprs.c |
| 4 | * |
| 5 | * GPRS over Phonet pipe end point socket |
| 6 | * |
| 7 | * Copyright (C) 2008 Nokia Corporation. |
| 8 | * |
Rémi Denis-Courmont | 31fdc55 | 2012-06-13 22:29:03 +0000 | [diff] [blame] | 9 | * Author: Rémi Denis-Courmont |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/netdevice.h> |
| 14 | #include <linux/if_ether.h> |
| 15 | #include <linux/if_arp.h> |
| 16 | #include <net/sock.h> |
| 17 | |
| 18 | #include <linux/if_phonet.h> |
| 19 | #include <net/tcp_states.h> |
| 20 | #include <net/phonet/gprs.h> |
| 21 | |
| 22 | #define GPRS_DEFAULT_MTU 1400 |
| 23 | |
| 24 | struct gprs_dev { |
| 25 | struct sock *sk; |
| 26 | void (*old_state_change)(struct sock *); |
David S. Miller | 676d236 | 2014-04-11 16:15:36 -0400 | [diff] [blame] | 27 | void (*old_data_ready)(struct sock *); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 28 | void (*old_write_space)(struct sock *); |
| 29 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 30 | struct net_device *dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 31 | }; |
| 32 | |
Harvey Harrison | 5c7f033 | 2008-11-06 23:10:50 -0800 | [diff] [blame] | 33 | static __be16 gprs_type_trans(struct sk_buff *skb) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 34 | { |
| 35 | const u8 *pvfc; |
| 36 | u8 buf; |
| 37 | |
| 38 | pvfc = skb_header_pointer(skb, 0, 1, &buf); |
| 39 | if (!pvfc) |
Harvey Harrison | 5c7f033 | 2008-11-06 23:10:50 -0800 | [diff] [blame] | 40 | return htons(0); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 41 | /* Look at IP version field */ |
| 42 | switch (*pvfc >> 4) { |
| 43 | case 4: |
| 44 | return htons(ETH_P_IP); |
| 45 | case 6: |
| 46 | return htons(ETH_P_IPV6); |
| 47 | } |
Harvey Harrison | 5c7f033 | 2008-11-06 23:10:50 -0800 | [diff] [blame] | 48 | return htons(0); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 49 | } |
| 50 | |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 51 | static void gprs_writeable(struct gprs_dev *gp) |
| 52 | { |
| 53 | struct net_device *dev = gp->dev; |
| 54 | |
| 55 | if (pep_writeable(gp->sk)) |
| 56 | netif_wake_queue(dev); |
| 57 | } |
| 58 | |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 59 | /* |
| 60 | * Socket callbacks |
| 61 | */ |
| 62 | |
| 63 | static void gprs_state_change(struct sock *sk) |
| 64 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 65 | struct gprs_dev *gp = sk->sk_user_data; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 66 | |
| 67 | if (sk->sk_state == TCP_CLOSE_WAIT) { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 68 | struct net_device *dev = gp->dev; |
| 69 | |
| 70 | netif_stop_queue(dev); |
| 71 | netif_carrier_off(dev); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 72 | } |
| 73 | } |
| 74 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 75 | static int gprs_recv(struct gprs_dev *gp, struct sk_buff *skb) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 76 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 77 | struct net_device *dev = gp->dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 78 | int err = 0; |
Harvey Harrison | 5c7f033 | 2008-11-06 23:10:50 -0800 | [diff] [blame] | 79 | __be16 protocol = gprs_type_trans(skb); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 80 | |
| 81 | if (!protocol) { |
| 82 | err = -EINVAL; |
| 83 | goto drop; |
| 84 | } |
| 85 | |
Rémi Denis-Courmont | fc6a110 | 2010-01-04 02:02:47 +0000 | [diff] [blame] | 86 | if (skb_headroom(skb) & 3) { |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 87 | struct sk_buff *rskb, *fs; |
| 88 | int flen = 0; |
| 89 | |
Rémi Denis-Courmont | fc6a110 | 2010-01-04 02:02:47 +0000 | [diff] [blame] | 90 | /* Phonet Pipe data header may be misaligned (3 bytes), |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 91 | * so wrap the IP packet as a single fragment of an head-less |
| 92 | * socket buffer. The network stack will pull what it needs, |
| 93 | * but at least, the whole IP payload is not memcpy'd. */ |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 94 | rskb = netdev_alloc_skb(dev, 0); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 95 | if (!rskb) { |
| 96 | err = -ENOBUFS; |
| 97 | goto drop; |
| 98 | } |
| 99 | skb_shinfo(rskb)->frag_list = skb; |
| 100 | rskb->len += skb->len; |
| 101 | rskb->data_len += rskb->len; |
| 102 | rskb->truesize += rskb->len; |
| 103 | |
| 104 | /* Avoid nested fragments */ |
David S. Miller | 5c313e9 | 2009-06-09 00:21:58 -0700 | [diff] [blame] | 105 | skb_walk_frags(skb, fs) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 106 | flen += fs->len; |
| 107 | skb->next = skb_shinfo(skb)->frag_list; |
David S. Miller | 5c313e9 | 2009-06-09 00:21:58 -0700 | [diff] [blame] | 108 | skb_frag_list_init(skb); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 109 | skb->len -= flen; |
| 110 | skb->data_len -= flen; |
| 111 | skb->truesize -= flen; |
| 112 | |
| 113 | skb = rskb; |
| 114 | } |
| 115 | |
| 116 | skb->protocol = protocol; |
| 117 | skb_reset_mac_header(skb); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 118 | skb->dev = dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 119 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 120 | if (likely(dev->flags & IFF_UP)) { |
| 121 | dev->stats.rx_packets++; |
| 122 | dev->stats.rx_bytes += skb->len; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 123 | netif_rx(skb); |
| 124 | skb = NULL; |
| 125 | } else |
| 126 | err = -ENODEV; |
| 127 | |
| 128 | drop: |
| 129 | if (skb) { |
| 130 | dev_kfree_skb(skb); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 131 | dev->stats.rx_dropped++; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 132 | } |
| 133 | return err; |
| 134 | } |
| 135 | |
David S. Miller | 676d236 | 2014-04-11 16:15:36 -0400 | [diff] [blame] | 136 | static void gprs_data_ready(struct sock *sk) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 137 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 138 | struct gprs_dev *gp = sk->sk_user_data; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 139 | struct sk_buff *skb; |
| 140 | |
| 141 | while ((skb = pep_read(sk)) != NULL) { |
| 142 | skb_orphan(skb); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 143 | gprs_recv(gp, skb); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 144 | } |
| 145 | } |
| 146 | |
| 147 | static void gprs_write_space(struct sock *sk) |
| 148 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 149 | struct gprs_dev *gp = sk->sk_user_data; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 150 | |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 151 | if (netif_running(gp->dev)) |
| 152 | gprs_writeable(gp); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | /* |
| 156 | * Network device callbacks |
| 157 | */ |
| 158 | |
Rémi Denis-Courmont | 4798a2b | 2008-12-15 00:53:57 -0800 | [diff] [blame] | 159 | static int gprs_open(struct net_device *dev) |
| 160 | { |
| 161 | struct gprs_dev *gp = netdev_priv(dev); |
| 162 | |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 163 | gprs_writeable(gp); |
Rémi Denis-Courmont | 4798a2b | 2008-12-15 00:53:57 -0800 | [diff] [blame] | 164 | return 0; |
| 165 | } |
| 166 | |
| 167 | static int gprs_close(struct net_device *dev) |
| 168 | { |
Rémi Denis-Courmont | 4798a2b | 2008-12-15 00:53:57 -0800 | [diff] [blame] | 169 | netif_stop_queue(dev); |
Rémi Denis-Courmont | 4798a2b | 2008-12-15 00:53:57 -0800 | [diff] [blame] | 170 | return 0; |
| 171 | } |
| 172 | |
Stephen Hemminger | 424efe9 | 2009-08-31 19:50:51 +0000 | [diff] [blame] | 173 | static netdev_tx_t gprs_xmit(struct sk_buff *skb, struct net_device *dev) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 174 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 175 | struct gprs_dev *gp = netdev_priv(dev); |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 176 | struct sock *sk = gp->sk; |
| 177 | int len, err; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 178 | |
| 179 | switch (skb->protocol) { |
| 180 | case htons(ETH_P_IP): |
| 181 | case htons(ETH_P_IPV6): |
| 182 | break; |
| 183 | default: |
| 184 | dev_kfree_skb(skb); |
Patrick McHardy | 6ed1065 | 2009-06-23 06:03:08 +0000 | [diff] [blame] | 185 | return NETDEV_TX_OK; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 188 | skb_orphan(skb); |
| 189 | skb_set_owner_w(skb, sk); |
| 190 | len = skb->len; |
| 191 | err = pep_write(sk, skb); |
| 192 | if (err) { |
Joe Perches | ba7a46f | 2014-11-11 10:59:17 -0800 | [diff] [blame] | 193 | net_dbg_ratelimited("%s: TX error (%d)\n", dev->name, err); |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 194 | dev->stats.tx_aborted_errors++; |
| 195 | dev->stats.tx_errors++; |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 196 | } else { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 197 | dev->stats.tx_packets++; |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 198 | dev->stats.tx_bytes += len; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Rémi Denis-Courmont | bbd5898 | 2009-06-01 00:35:16 +0000 | [diff] [blame] | 201 | netif_stop_queue(dev); |
| 202 | if (pep_writeable(sk)) |
| 203 | netif_wake_queue(dev); |
Patrick McHardy | 6ed1065 | 2009-06-23 06:03:08 +0000 | [diff] [blame] | 204 | return NETDEV_TX_OK; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 205 | } |
| 206 | |
Stephen Hemminger | ab638e6 | 2009-01-07 17:24:34 -0800 | [diff] [blame] | 207 | static const struct net_device_ops gprs_netdev_ops = { |
| 208 | .ndo_open = gprs_open, |
| 209 | .ndo_stop = gprs_close, |
| 210 | .ndo_start_xmit = gprs_xmit, |
Stephen Hemminger | ab638e6 | 2009-01-07 17:24:34 -0800 | [diff] [blame] | 211 | }; |
| 212 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 213 | static void gprs_setup(struct net_device *dev) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 214 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 215 | dev->features = NETIF_F_FRAGLIST; |
Rémi Denis-Courmont | 57c81ff | 2008-12-17 15:47:48 -0800 | [diff] [blame] | 216 | dev->type = ARPHRD_PHONET_PIPE; |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 217 | dev->flags = IFF_POINTOPOINT | IFF_NOARP; |
| 218 | dev->mtu = GPRS_DEFAULT_MTU; |
Jarod Wilson | b3e3893 | 2016-10-20 13:55:22 -0400 | [diff] [blame] | 219 | dev->min_mtu = 576; |
| 220 | dev->max_mtu = (PHONET_MAX_MTU - 11); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 221 | dev->hard_header_len = 0; |
| 222 | dev->addr_len = 0; |
| 223 | dev->tx_queue_len = 10; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 224 | |
Stephen Hemminger | ab638e6 | 2009-01-07 17:24:34 -0800 | [diff] [blame] | 225 | dev->netdev_ops = &gprs_netdev_ops; |
David S. Miller | cf124db | 2017-05-08 12:52:56 -0400 | [diff] [blame] | 226 | dev->needs_free_netdev = true; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | /* |
| 230 | * External interface |
| 231 | */ |
| 232 | |
| 233 | /* |
| 234 | * Attach a GPRS interface to a datagram socket. |
| 235 | * Returns the interface index on success, negative error code on error. |
| 236 | */ |
| 237 | int gprs_attach(struct sock *sk) |
| 238 | { |
| 239 | static const char ifname[] = "gprs%d"; |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 240 | struct gprs_dev *gp; |
| 241 | struct net_device *dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 242 | int err; |
| 243 | |
| 244 | if (unlikely(sk->sk_type == SOCK_STREAM)) |
| 245 | return -EINVAL; /* need packet boundaries */ |
| 246 | |
| 247 | /* Create net device */ |
Tom Gundersen | c835a67 | 2014-07-14 16:37:24 +0200 | [diff] [blame] | 248 | dev = alloc_netdev(sizeof(*gp), ifname, NET_NAME_UNKNOWN, gprs_setup); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 249 | if (!dev) |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 250 | return -ENOMEM; |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 251 | gp = netdev_priv(dev); |
Rémi Denis-Courmont | 893873f | 2008-12-17 15:48:50 -0800 | [diff] [blame] | 252 | gp->sk = sk; |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 253 | gp->dev = dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 254 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 255 | netif_stop_queue(dev); |
| 256 | err = register_netdev(dev); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 257 | if (err) { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 258 | free_netdev(dev); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 259 | return err; |
| 260 | } |
| 261 | |
| 262 | lock_sock(sk); |
| 263 | if (unlikely(sk->sk_user_data)) { |
| 264 | err = -EBUSY; |
| 265 | goto out_rel; |
| 266 | } |
| 267 | if (unlikely((1 << sk->sk_state & (TCPF_CLOSE|TCPF_LISTEN)) || |
| 268 | sock_flag(sk, SOCK_DEAD))) { |
| 269 | err = -EINVAL; |
| 270 | goto out_rel; |
| 271 | } |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 272 | sk->sk_user_data = gp; |
| 273 | gp->old_state_change = sk->sk_state_change; |
| 274 | gp->old_data_ready = sk->sk_data_ready; |
| 275 | gp->old_write_space = sk->sk_write_space; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 276 | sk->sk_state_change = gprs_state_change; |
| 277 | sk->sk_data_ready = gprs_data_ready; |
| 278 | sk->sk_write_space = gprs_write_space; |
| 279 | release_sock(sk); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 280 | sock_hold(sk); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 281 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 282 | printk(KERN_DEBUG"%s: attached\n", dev->name); |
| 283 | return dev->ifindex; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 284 | |
| 285 | out_rel: |
| 286 | release_sock(sk); |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 287 | unregister_netdev(dev); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 288 | return err; |
| 289 | } |
| 290 | |
| 291 | void gprs_detach(struct sock *sk) |
| 292 | { |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 293 | struct gprs_dev *gp = sk->sk_user_data; |
| 294 | struct net_device *dev = gp->dev; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 295 | |
| 296 | lock_sock(sk); |
| 297 | sk->sk_user_data = NULL; |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 298 | sk->sk_state_change = gp->old_state_change; |
| 299 | sk->sk_data_ready = gp->old_data_ready; |
| 300 | sk->sk_write_space = gp->old_write_space; |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 301 | release_sock(sk); |
| 302 | |
Rémi Denis-Courmont | 09a2c3c | 2008-12-16 01:18:31 -0800 | [diff] [blame] | 303 | printk(KERN_DEBUG"%s: detached\n", dev->name); |
| 304 | unregister_netdev(dev); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 305 | sock_put(sk); |
Rémi Denis-Courmont | 02a4761 | 2008-10-05 11:16:16 -0700 | [diff] [blame] | 306 | } |