# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.563 -> 1.564 # drivers/usb/net/pegasus.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/04/30 david-b@pacbell.net 1.564 # [PATCH] PATCH 2.5.10 -- pegasus ethtool support # # This resends the "usb_make_path()" update (my net-0408 patch) # to pegasus, so it reports the same bus info the other usb network # drivers now return, and fixes a couple other bugs in ethtool support I # happened to notice: # # - driver info wasn't providing the "driver short name". # - settings weren't correctly initting data (returned garbage) # # The first bug caused one text fields to overflow into the next in # "ethtool -i eth1" output. The second caused a 10/100 device # to report itself with "ethtool eth1" as having gigabit support ... :) # -------------------------------------------- # diff -Nru a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c --- a/drivers/usb/net/pegasus.c Thu May 2 16:48:42 2002 +++ b/drivers/usb/net/pegasus.c Thu May 2 16:48:42 2002 @@ -62,6 +62,8 @@ #define DRIVER_AUTHOR "Petko Manolov " #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" +static const char driver_name [] = "pegasus"; + #define PEGASUS_USE_INTR #define PEGASUS_WRITE_EEPROM #define BMSR_MEDIA (BMSR_10HALF | BMSR_10FULL | BMSR_100HALF | \ @@ -811,7 +813,6 @@ { pegasus_t *pegasus; int cmd; - char tmp[128]; pegasus = net->priv; if (get_user(cmd, (int *) uaddr)) @@ -819,12 +820,11 @@ switch (cmd) { case ETHTOOL_GDRVINFO:{ struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; - strncpy(info.driver, DRIVER_DESC, ETHTOOL_BUSINFO_LEN); + strncpy(info.driver, driver_name, sizeof info.driver); strncpy(info.version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN); - sprintf(tmp, "usb%d:%d", pegasus->usb->bus->busnum, - pegasus->usb->devnum); - strncpy(info.bus_info, tmp, ETHTOOL_BUSINFO_LEN); + usb_make_path(pegasus->usb, info.bus_info, + sizeof info.bus_info); if (copy_to_user(uaddr, &info, sizeof(info))) return -EFAULT; return 0; @@ -833,8 +833,7 @@ struct ethtool_cmd ecmd; short lpa, bmcr; - if (copy_from_user(&ecmd, uaddr, sizeof(ecmd))) - return -EFAULT; + memset(&ecmd, 0, sizeof ecmd); ecmd.supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | @@ -1104,7 +1103,7 @@ } static struct usb_driver pegasus_driver = { - name: "pegasus", + name: driver_name, probe: pegasus_probe, disconnect: pegasus_disconnect, id_table: pegasus_ids,