[PATCH] readmif and writemif on don't work on PPC


From: Ted Phelps (phelps_at_dstc.edu.au)
Date: 2002-08-27 09:32:12 UTC


Hi Jouni,

Thanks for all of your work on the Host-AP driver! Well done!

One minor issue: there would appear to be an endian/value-size issue with the readmif and writemif calls (making it hard to twiddle the diversity antenna settings). I'm not sure if it's what you had in mind, but the following patch, against CVS of 2002/08/27 10:30:11 UTC, appears to help.

Cheers,
-Ted

---8<---

Index: ./driver/modules/hostap_ioctl.c



RCS file: /cvs/hostap/driver/modules/hostap_ioctl.c,v retrieving revision 1.7
diff -u -r1.7 hostap_ioctl.c
--- ./driver/modules/hostap_ioctl.c	24 Jul 2002 08:23:04 -0000	1.7
+++ ./driver/modules/hostap_ioctl.c	23 Aug 2002 15:46:18 -0000

@@ -1570,7 +1570,7 @@
IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, "readmif" }, { PRISM2_IOCTL_WRITEMIF, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "writemif" }, + IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 2, 0, "writemif" }, { PRISM2_IOCTL_RESET, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "reset" }, { PRISM2_IOCTL_INQUIRE,

@@ -2079,13 +2079,13 @@

 {
 	local_info_t *local = (local_info_t *) dev->priv;
 	u16 val, resp0;
-	int *i = (int *) extra;
 
-	val = *i;
-	if (local->func->cmd(dev, HFA384X_CMDCODE_READMIF, val, NULL, &resp0))
-		return -EOPNOTSUPP;
-	else
-		*i = resp0;
+	val = *extra;
+	if (local->func->cmd(dev, HFA384X_CMDCODE_READMIF, val, NULL, &resp0)) {
+	    return -EOPNOTSUPP;
+	} else {
+	    *extra = resp0;
+	}
 
 	return 0;

 }
@@ -2097,10 +2097,9 @@

 {
 	local_info_t *local = (local_info_t *) dev->priv;
 	u16 cr, val;
-	int *i = (int *) extra;
 
-	cr = *i;
-	val = *(i + 1);
+	cr = *extra;
+	val = *(extra + 1);
 	if (local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF, cr, &val, NULL))
 		return -EOPNOTSUPP;
 


This archive was generated by hypermail 2.1.4.