diff options
-rw-r--r-- | drivers/net/usb/cdc-phonet.c | 15 | ||||
-rw-r--r-- | include/linux/phonet.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 0ca5916ca8df..97e54d9d03ce 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
28 | #include <linux/if_arp.h> | 28 | #include <linux/if_arp.h> |
29 | #include <linux/if_phonet.h> | 29 | #include <linux/if_phonet.h> |
30 | #include <linux/phonet.h> | ||
30 | 31 | ||
31 | #define PN_MEDIA_USB 0x1B | 32 | #define PN_MEDIA_USB 0x1B |
32 | 33 | ||
@@ -256,6 +257,19 @@ static int usbpn_close(struct net_device *dev) | |||
256 | return usb_set_interface(pnd->usb, num, !pnd->active_setting); | 257 | return usb_set_interface(pnd->usb, num, !pnd->active_setting); |
257 | } | 258 | } |
258 | 259 | ||
260 | static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | ||
261 | { | ||
262 | struct if_phonet_req *req = (struct if_phonet_req *)ifr; | ||
263 | |||
264 | switch (cmd) { | ||
265 | case SIOCPNGAUTOCONF: | ||
266 | req->ifr_phonet_autoconf.device = PN_DEV_PC; | ||
267 | printk(KERN_CRIT"device is PN_DEV_PC\n"); | ||
268 | return 0; | ||
269 | } | ||
270 | return -ENOIOCTLCMD; | ||
271 | } | ||
272 | |||
259 | static int usbpn_set_mtu(struct net_device *dev, int new_mtu) | 273 | static int usbpn_set_mtu(struct net_device *dev, int new_mtu) |
260 | { | 274 | { |
261 | if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) | 275 | if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) |
@@ -269,6 +283,7 @@ static const struct net_device_ops usbpn_ops = { | |||
269 | .ndo_open = usbpn_open, | 283 | .ndo_open = usbpn_open, |
270 | .ndo_stop = usbpn_close, | 284 | .ndo_stop = usbpn_close, |
271 | .ndo_start_xmit = usbpn_xmit, | 285 | .ndo_start_xmit = usbpn_xmit, |
286 | .ndo_do_ioctl = usbpn_ioctl, | ||
272 | .ndo_change_mtu = usbpn_set_mtu, | 287 | .ndo_change_mtu = usbpn_set_mtu, |
273 | }; | 288 | }; |
274 | 289 | ||
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 82b45d16e50c..1ef5a0781831 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
@@ -99,6 +99,9 @@ struct sockaddr_pn { | |||
99 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 99 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
100 | } __attribute__ ((packed)); | 100 | } __attribute__ ((packed)); |
101 | 101 | ||
102 | /* Well known address */ | ||
103 | #define PN_DEV_PC 0x10 | ||
104 | |||
102 | static inline __u16 pn_object(__u8 addr, __u16 port) | 105 | static inline __u16 pn_object(__u8 addr, __u16 port) |
103 | { | 106 | { |
104 | return (addr << 8) | (port & 0x3ff); | 107 | return (addr << 8) | (port & 0x3ff); |