Help needed: SanDisk Connect Plus with hostap_cs on Sharp Zaurus
Pavel Roskin
proski
Wed Apr 14 15:01:44 PDT 2004
Wed, 14 Apr 2004, Pavel Roskin wrote:
> The initialization process is written in some pseudocode, but I think it
> can be easily integrated into hostap. Let me know if you are ready to
> test the patch against hostap 0.2.0.
The patch is attached. It not ready for applying and may need further
work, but should be OK as a starting point. It can be applied to version
0.2.0 and the CVS version.
Use "iwconfig wlan0 reset 1" to force COR reset. Use util/hostap_fw_load
to load the firmware. The firmware can be downloaded from
http://www.red-bean.com/~proski/firmware/ (I don't have 1.8.2 firmware, so
please adjust the script accordingly to use 1.8.0 firmware).
It would be interesting to see the output of "cardctl ident" and "cardctl
config". I'm not sure if the wireless part is function 0, which the
driver assumes in several places.
--
Regards,
Pavel Roskin
-------------- next part --------------
--- driver/modules/hostap_cs.c
+++ driver/modules/hostap_cs.c
@@ -220,6 +220,7 @@ static void prism2_pccard_cor_sreset(loc
{
int res;
conf_reg_t reg;
+ struct net_device *dev = local->dev;
if (!prism2_pccard_card_present(local))
return;
@@ -257,6 +258,51 @@ static void prism2_pccard_cor_sreset(loc
}
mdelay(2);
+
+ if (local->link->io.NumPorts1 > 0x42) {
+ unsigned long int base = local->dev->base_addr; /* may need tweaking */
+
+ printk("Setting I/O base to 0x%lx\n", base);
+
+ /* Set I/O base - low word */
+ reg.Function = 0;
+ reg.Action = CS_WRITE;
+ reg.Offset = CISREG_IOBASE_3;
+ reg.Value = base & 0xff;
+
+ res = pcmcia_access_configuration_register(local->link->handle, ®);
+ if (res != CS_SUCCESS) {
+ printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 4 (%d)\n",
+ res);
+ return;
+ }
+
+ mdelay(10);
+
+ /* Set I/O base - high word */
+ reg.Function = 0;
+ reg.Action = CS_WRITE;
+ reg.Offset = CISREG_IOSIZE;
+ reg.Value = (base >> 8) & 0xff;
+
+ res = pcmcia_access_configuration_register(local->link->handle, ®);
+ if (res != CS_SUCCESS) {
+ printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 4 (%d)\n",
+ res);
+ return;
+ }
+
+ mdelay(10);
+
+ printk("Activating wireless function\n");
+ /* Activate the wireless function */
+ HFA384X_OUTB(0xc5, 0x40);
+ mdelay(10);
+ HFA384X_OUTB(0x4b, 0x40);
+ mdelay(10);
+ } else {
+ printk("Not enough port space: 0x%x\n", local->link->io.NumPorts1);
+ }
}
@@ -265,6 +311,7 @@ static void prism2_pccard_genesis_reset(
int res;
conf_reg_t reg;
int old_cor;
+ struct net_device *dev = local->dev;
if (!prism2_pccard_card_present(local))
return;
@@ -317,6 +364,24 @@ static void prism2_pccard_genesis_reset(
}
mdelay(10);
+
+ if (local->link->io.NumPorts1 > 0x42) {
+ int i;
+
+ printk("Setting HCR directly to 0x%x\n", hcr);
+
+ HFA384X_OUTB(0x80, 0x40);
+ mdelay(50);
+
+ for(i = 0; i < 10; i++)
+ HFA384X_OUTB(hcr, 0x42);
+
+ mdelay(55);
+
+ HFA384X_OUTB(0x45, 0x40);
+ } else {
+ printk("Not enough port space: 0x%x\n", local->link->io.NumPorts1);
+ }
}
More information about the Hostap
mailing list