From 02571f89871e009b66fb5f8d5ae222e90e9f357c Mon Sep 17 00:00:00 2001 From: Rémi Denis-Courmont Date: Wed, 9 Sep 2009 00:00:06 +0000 Subject: cdc-phonet: autoconfigure Phonet address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Denis-Courmont Signed-off-by: David S. Miller --- drivers/net/usb/cdc-phonet.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/net/usb/cdc-phonet.c') diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 0ca5916ca8d..97e54d9d03c 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -27,6 +27,7 @@ #include #include #include +#include #define PN_MEDIA_USB 0x1B @@ -256,6 +257,19 @@ static int usbpn_close(struct net_device *dev) return usb_set_interface(pnd->usb, num, !pnd->active_setting); } +static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + struct if_phonet_req *req = (struct if_phonet_req *)ifr; + + switch (cmd) { + case SIOCPNGAUTOCONF: + req->ifr_phonet_autoconf.device = PN_DEV_PC; + printk(KERN_CRIT"device is PN_DEV_PC\n"); + return 0; + } + return -ENOIOCTLCMD; +} + static int usbpn_set_mtu(struct net_device *dev, int new_mtu) { if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) @@ -269,6 +283,7 @@ static const struct net_device_ops usbpn_ops = { .ndo_open = usbpn_open, .ndo_stop = usbpn_close, .ndo_start_xmit = usbpn_xmit, + .ndo_do_ioctl = usbpn_ioctl, .ndo_change_mtu = usbpn_set_mtu, }; -- cgit v1.2.3-70-g09d2