[Prism54-devel] prism54 on powerpc working with small patch

Harald Welte laforge@gnumonks.org
Sat, 1 Nov 2003 18:45:37 +0100


--AXxEqdD4tcVTjWte
Content-Type: multipart/mixed; boundary="mhOzvPhkurUs4vA9"
Content-Disposition: inline


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

On Sat, Nov 01, 2003 at 05:25:42PM +0100, Herbert Valerio Riedel wrote:
> On Sat, 2003-11-01 at 16:49, Harald Welte wrote:
> > Hi!
> >=20
> > I'm trying to get the prism54 to work on my G4 Powerbook IV using a
> > Cardbus SMC2835W card. Has anybody managed to run prism54 on linux/ppc
> > so far?
>=20
> I'm quite sure it wouldn't work; quite a few 32/16bit write/read's
> to/from ioremap'ed memory are performed in host horder... :-/

It seems to be better than you thought. It's running now, without any
problems (Allnet AL0277 basestation, similar to Linksys WRT54G, no WEP).

> but you're a welcome tester and you've motivated me to give this issue a
> higher priority... expect some of the next cvs commits to be related to
> portability :-)

Please see the attached patch.  It has two hunks, one of them just fixes
debug statements, and the other one is a one-line 'fix'.

This needs more discussion.  Why are you converting cpu_to_le32() the
buffer value?  Assuming the driver was written on x86, it doesn't make
sense, since cpu =3D=3D le32

On ppc it does actually the byte-swap _and_ doesn't work, the oops was
related to that statement.

If I'm not mistaken, the code tries to put the 32bit address of the psm
buffer into a command frame for the intersil chip.  The intersil chip
will see this address from the pci bus perspective. =20

The pci bus can have a different view of the world than the host cpu,
but that's hidden behind the pci API.  sinec psm_buffer is derived from
device_host_address, which is in turn returned by pci_alloc_consistent,
I don't think you need to do any conversion at that point.

Keep up the good work!

> --=20
> Herbert Valerio Riedel       /    Phone: (EUROPE) +43-1-58801-18840
> Email: hvr@hvrlab.org       /    Finger hvr@gnu.org for GnuPG Public Key
> GnuPG Key Fingerprint: 7BB9 2D6C D485 CE64 4748  5F65 4981 E064 883F 4142

--=20
- Harald Welte <laforge@gnumonks.org>               http://www.gnumonks.org/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Programming is like sex: One mistake and you have to support it your lifeti=
me

--mhOzvPhkurUs4vA9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="prism54-031031-ppc-fixes.patch"
Content-Transfer-Encoding: quoted-printable

diff -Nru linuxppc24bh-031031-prism54-plain/drivers/net/wireless/prism54/is=
l_ioctl.c linuxppc24bh-031031-prism54/drivers/net/wireless/prism54/isl_ioct=
l.c
--- linuxppc24bh-031031-prism54-plain/drivers/net/wireless/prism54/isl_ioct=
l.c	2003-11-01 18:24:45.000000000 +0100
+++ linuxppc24bh-031031-prism54/drivers/net/wireless/prism54/isl_ioctl.c	20=
03-11-01 16:57:24.000000000 +0100
@@ -2185,8 +2185,8 @@
     DEBUG(SHOW_FUNCTION_CALLS, "isl_ioctl cmd %x \n", cmd);
=20
     DEBUG(SHOW_QUEUE_INDEXES, "Mgmt Tx Qs: free[%i] shdw[%i]\n",
-        islpci_queue_size(device, &private_config->mgmt_tx_freeq),
-        islpci_queue_size(device, &private_config->mgmt_tx_shadowq));
+        islpci_queue_size(&private_config->mgmt_tx_freeq),
+        islpci_queue_size(&private_config->mgmt_tx_shadowq));
 #endif
=20
     switch (cmd)
@@ -2653,11 +2653,11 @@
 #if VERBOSE > SHOW_ERROR_MESSAGES
     DEBUG(SHOW_QUEUE_INDEXES,
         "Mgmt Rx Qs: f[%i] s[%i] i[%i] t[%i] p[%i]\n",
-        islpci_queue_size(device, &private_config->mgmt_rx_freeq),
-        islpci_queue_size(device, &private_config->mgmt_rx_shadowq),
-        islpci_queue_size(device, &private_config->ioctl_rx_queue),
-        islpci_queue_size(device, &private_config->trap_rx_queue),
-        islpci_queue_size(device, &private_config->pimfor_rx_queue));
+        islpci_queue_size(&private_config->mgmt_rx_freeq),
+        islpci_queue_size(&private_config->mgmt_rx_shadowq),
+        islpci_queue_size(&private_config->ioctl_rx_queue),
+        islpci_queue_size(&private_config->trap_rx_queue),
+        islpci_queue_size(&private_config->pimfor_rx_queue));
 #endif
=20
     return error;
diff -Nru linuxppc24bh-031031-prism54-plain/drivers/net/wireless/prism54/is=
lpci_mgt.c linuxppc24bh-031031-prism54/drivers/net/wireless/prism54/islpci_=
mgt.c
--- linuxppc24bh-031031-prism54-plain/drivers/net/wireless/prism54/islpci_m=
gt.c	2003-11-01 18:24:45.000000000 +0100
+++ linuxppc24bh-031031-prism54/drivers/net/wireless/prism54/islpci_mgt.c	2=
003-11-01 18:05:50.000000000 +0100
@@ -331,7 +331,7 @@
=20
     // set the PSM buffer object
     islpci_mgt_queue(private_config, PIMFOR_OP_SET,
-        DOT11_OID_PSMBUFFER, 0, (void *) cpu_to_le32( &psm_buffer ),
+        DOT11_OID_PSMBUFFER, 0, (void *) &psm_buffer,
         sizeof(struct obj_buffer), 0);
=20
     // set the authentication enable option

--mhOzvPhkurUs4vA9--

--AXxEqdD4tcVTjWte
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQE/o/FAXaXGVTD0i/8RAvrnAKCbsyT/jejcO28Yi4eCbTF8puKZuwCgsfj1
APxGmKXelvlNb0QRDcnsjBs=
=yJ8t
-----END PGP SIGNATURE-----

--AXxEqdD4tcVTjWte--