[Prism54-devel] Suggested Prism54 changes/cleanup

Luis R. Rodriguez mcgrof@ruslug.rutgers.edu
Sun, 22 Feb 2004 01:40:14 -0500


--1Ow488MNN9B9o/ov
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


Thanks, Margit, the patch has been applied.

	Luis

On Sat, Feb 21, 2004 at 06:05:27PM +0100, Margit Schubert-While wrote:
> Suggested code changes/cleanup.
> (Luis, sent to you as attachment)
> Fix compile warning
> Correct multi-line printk's
> Move prism54_get_card_model and clean ip.
>=20
> diff -Naur prism54-cvs-latest/ksrc/isl_ioctl.c prism54-msw/ksrc/isl_ioctl=
.c
> --- prism54-cvs-latest/ksrc/isl_ioctl.c 2004-02-20 05:20:48.000000000 +01=
00
> +++ prism54-msw/ksrc/isl_ioctl.c        2004-02-21 17:35:32.000000000 +01=
00
> @@ -93,8 +93,8 @@
>=20
>         /* For now, just catch early the Repeater and Secondary modes her=
e=20
>         */
>         if (iw_mode =3D=3D IW_MODE_REPEAT || iw_mode =3D=3D IW_MODE_SECON=
D) {
> -               printk(KERN_DEBUG "%s(): Sorry, Repeater mode and Seconda=
ry=20
> mode \
> -                               are not yet supported by this driver.\n",
> +               printk(KERN_DEBUG "%s(): Sorry, Repeater mode and Seconda=
ry=20
> mode "
> +                               "are not yet supported by this driver.\n",
>                        __FUNCTION__);
>                 return -EINVAL;
>         }
> @@ -171,8 +171,8 @@
>          * mib values depending on what the wireless mode given is. No ne=
ed
>          * for it save old values */
>         if (init_mode > IW_MODE_MONITOR || init_mode < IW_MODE_AUTO) {
> -               printk(KERN_DEBUG "%s(): You passed a non-valid init_mode=
. \
> -                               Using default mode\n", __FUNCTION__);
> +               printk(KERN_DEBUG "%s(): You passed a non-valid init_mode=
. "
> +                               "Using default mode\n", __FUNCTION__);
>                 init_mode =3D CARD_DEFAULT_IW_MODE;
>         }
>         /* This sets all of the mode-dependent values */
> diff -Naur prism54-cvs-latest/ksrc/islpci_dev.c=20
> prism54-msw/ksrc/islpci_dev.c
> --- prism54-cvs-latest/ksrc/islpci_dev.c        2004-02-16=20
> 22:01:35.000000000 +0100
> +++ prism54-msw/ksrc/islpci_dev.c       2004-02-21 17:19:55.000000000 +01=
00
> @@ -781,56 +781,3 @@
>         priv =3D 0;
>         return NULL;
>  }
> -
> -inline int
> -prism54_get_card_model(struct net_device *ndev, char **modelp)
> -{
> -       islpci_private *priv;
> -       priv =3D ndev->priv;
> -       switch (priv->pdev->subsystem_device) {
> -       case PCIDEVICE_ISL3877:
> -               *modelp =3D "PRISM Indigo";
> -               break;
> -       case PCIDEVICE_3COM6001:
> -               *modelp =3D "3COM 3CRWE154G72";
> -               break;
> -       case 0x3202UL:
> -               *modelp =3D "D-Link DWL-g650 A1";
> -               break;
> -       case 0xd019UL:
> -               *modelp =3D "WN-G54/CB";
> -               break;
> -       case 0x4800UL:
> -               *modelp =3D "Netgear WG511";
> -               break;
> -       case 0x2802UL:
> -               *modelp =3D "SMC2802W";
> -               break;
> -       case 0xee03UL:
> -               *modelp =3D "SMC2802W V2";
> -               break;
> -       case 0x2835UL:
> -               *modelp =3D "SMC2835W";
> -               break;
> -               /* Let's leave this one out for now since it seems=20
> bogus/wrong
> -                * Even if the manufacturer did use 0x0000UL it may not b=
e=20
> correct
> -                * by their part, therefore deserving no name ;) */
> -               /*      case 0x0000UL:
> -                *              return "SparkLAN WL-850F";
> -                *              break;*/
> -
> -               /* We have two reported for the one bellow :( */
> -       case 0x0014UL:
> -               *modelp =3D "XG-600";
> -               break;
> -       case 0x0020UL:
> -               *modelp =3D "XG-900/GW-DS54G";
> -               break;
> -       case PCIDEVICE_ISL3890:
> -               *modelp =3D "PRISM Duette/GT";
> -               break;
> -       default:
> -               *modelp =3D "PRISM Duette/GT";
> -       }
> -       return 0;
> -}
> diff -Naur prism54-cvs-latest/ksrc/islpci_dev.h=20
> prism54-msw/ksrc/islpci_dev.h
> --- prism54-cvs-latest/ksrc/islpci_dev.h        2004-02-20=20
> 04:41:00.000000000 +0100
> +++ prism54-msw/ksrc/islpci_dev.h       2004-02-21 17:19:14.000000000 +01=
00
> @@ -275,5 +275,4 @@
>  int islpci_alloc_memory(islpci_private *);
>  int islpci_free_memory(islpci_private *);
>  struct net_device *islpci_setup(struct pci_dev *);
> -inline int prism54_get_card_model(struct net_device *, char **);
>  #endif                         /* _ISLPCI_DEV_H */
> diff -Naur prism54-cvs-latest/ksrc/islpci_hotplug.c=20
> prism54-msw/ksrc/islpci_hotplug.c
> --- prism54-cvs-latest/ksrc/islpci_hotplug.c    2004-01-30=20
> 07:14:13.000000000 +0100
> +++ prism54-msw/ksrc/islpci_hotplug.c   2004-02-21 18:01:54.000000000 +01=
00
> @@ -127,6 +127,66 @@
>         /* .enable_wake ; we don't support this yet */
>  };
>=20
> +static void
> +prism54_get_card_model(struct net_device *ndev)
> +{
> +       islpci_private  *priv;
> +       char            *modelp;
> +
> +       priv =3D ndev->priv;
> +       switch (priv->pdev->subsystem_device) {
> +       case PCIDEVICE_ISL3877:
> +               modelp =3D "PRISM Indigo";
> +               break;
> +       case PCIDEVICE_3COM6001:
> +               modelp =3D "3COM 3CRWE154G72";
> +               break;
> +       case 0x3202UL:
> +               modelp =3D "D-Link DWL-g650 A1";
> +               break;
> +       case 0xd019UL:
> +               modelp =3D "WN-G54/CB";
> +               break;
> +       case 0x4800UL:
> +               modelp =3D "Netgear WG511";
> +               break;
> +       case 0x2802UL:
> +               modelp =3D "SMC2802W";
> +               break;
> +       case 0xee03UL:
> +               modelp =3D "SMC2802W V2";
> +               break;
> +       case 0x2835UL:
> +               modelp =3D "SMC2835W";
> +               break;
> +       /* Let's leave this one out for now since it seems bogus/wrong
> +        * Even if the manufacturer did use 0x0000UL it may not be correct
> +        * by their part, therefore deserving no name ;) */
> +       /*      case 0x0000UL:
> +        *              modelp =3D "SparkLAN WL-850F";
> +        *              break;*/
> +
> +       /* We have two reported for the one below :( */
> +       case 0x0014UL:
> +               modelp =3D "XG-600";
> +               break;
> +       case 0x0020UL:
> +               modelp =3D "XG-900/GW-DS54G";
> +               break;
> +/* Default it */
> +/*
> +       case PCIDEVICE_ISL3890:
> +               modelp =3D "PRISM Duette/GT";
> +               break;
> +*/
> +       default:
> +               modelp =3D "PRISM Duette/GT";
> +       }
> +       printk(KERN_DEBUG "%s: %s driver detected card model: %s\n",
> +                       ndev->name, DRV_NAME, modelp);
> +       return;
> +}
> +
>  /***********************************************************************=
*******
>      Module initialization functions
>  ************************************************************************=
******/
> @@ -139,8 +199,6 @@
>         u32 mem_addr;
>         islpci_private *priv;
>         int rvalue;
> -       char *model;
> -       char **modelp;
>=20
>         /* TRACE(DRV_NAME); */
>=20
> @@ -151,9 +209,6 @@
>                 return -ENODEV;
>         }
>=20
> -       model =3D "PRISM Duette/GT"; /* Default */
> -       modelp =3D &model;
> -
>         /* check whether the latency timer is set correctly */
>         pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &latency_tmr);
>  #if VERBOSE > SHOW_ERROR_MESSAGES
> @@ -234,16 +289,8 @@
>=20
>         /* firmware upload is triggered in islpci_open */
>=20
> -       /* Perty card model discovery output */
> -       if (prism54_get_card_model(ndev, modelp)) {
> -               printk(KERN_DEBUG "%s: Unable to determine specific card=
=20
> model\n",
> -                               ndev->name);
> -       }
> -       else {
> -               model =3D *modelp;
> -               printk(KERN_DEBUG "%s: %s driver detected card model: %s\=
n",
> -                               ndev->name, DRV_NAME, model);
> -       }
> +       /* Pretty card model discovery output */
> +       prism54_get_card_model(ndev);
>=20
>         return 0;
>=20
> diff -Naur prism54-cvs-latest/ksrc/oid_mgt.c prism54-msw/ksrc/oid_mgt.c
> --- prism54-cvs-latest/ksrc/oid_mgt.c   2004-02-02 18:12:28.000000000 +01=
00
> +++ prism54-msw/ksrc/oid_mgt.c  2004-02-21 17:39:07.000000000 +0100
> @@ -384,8 +384,8 @@
>=20
>         if (reslen > isl_oid[n].size)
>                 printk(KERN_DEBUG
> -                      "mgt_get_request(0x%x): received data length was=
=20
> bigger \
> -                      than expected (%d > %d). Memory is probably=20
> corrupted... ",
> +                      "mgt_get_request(0x%x): received data length was=
=20
> bigger "
> +                      "than expected (%d > %d). Memory is probably=20
> corrupted... ",
>                        oid, reslen, isl_oid[n].size);
>=20
>         return ret;
> @@ -485,8 +485,8 @@
>         if (rvalue) {
>                 /* some request have failed. The device might be in an
>                    incoherent state. We should reset it ! */
> -               printk(KERN_DEBUG "%s: mgt_commit has failed. Restart the=
 \
> -                device \n", priv->ndev->name);
> +               printk(KERN_DEBUG "%s: mgt_commit has failed. Restart the=
 "
> +                "device \n", priv->ndev->name);
>         }
>=20
>         /* update the MAC addr. As it's not cached, no lock will be=20
> acquired by
>=20
>=20
> Margit

--=20
Key fingerprint =3D 113F B290 C6D2 0251 4D84  A34A 6ADD 4937 E20A 525E

--1Ow488MNN9B9o/ov
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAOE7Oat1JN+IKUl4RAt62AKCEvmLmW9v0R8RCoqLyO/AnDCSbsACZAR2P
986Ot7m61YmQOfYoNDXh9rY=
=TIoE
-----END PGP SIGNATURE-----

--1Ow488MNN9B9o/ov--