modify PDA to control txpower
William Tai
williamt
Mon Aug 4 19:57:30 PDT 2003
----- Original Message -----
From: "Jouni Malinen" <jkmaline at cc.hut.fi>
To: <hostap at shmoo.com>
Sent: Monday, August 04, 2003 7:31 PM
Subject: Re: modify PDA to control txpower
> On Mon, Aug 04, 2003 at 11:00:52AM -0700, William Tai wrote:
>
> > I am trying modify PDR 0x0300 and PDR 0x0301 to control txpower by
> > calling prism2_download_volatile( ).
>
> You are trying to modify PDA by using _volatile_ download?? PDA is a
> block in flash.. In addition, please note that changing the PDA values
> does not really change anything unless you download a new image after
> that. In many cases, it would probably be easier to just modify
> prism2_srec to overrite card PDA with something else when plugging PDRs.
>
I add two lines of the codes in prism2_read_pda( ) and then it works.
/*static*/ u8 * prism2_read_pda(struct device *dev)
{
u8 *buf;
int res, i, found = 0;
#define NUM_PDA_ADDRS 3
unsigned int pda_addr[NUM_PDA_ADDRS] = {
0x7f0000 /* others than HFA3841 */,
0x3f0000 /* HFA3841 */,
0x390000 /* apparently used in older cards */
};
u16 setpoint[14]={0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0,
0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0};
// buf = (u8 *) kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL);
buf = (u8 *) malloc(PRISM2_PDA_SIZE);
if (buf == NULL)
return NULL;
/* Note: wlan card should be in initial state (just after init cmd)
* and no other operations should be performed concurrently. */
prism2_enable_aux_port(dev, 1);
for (i = 0; i < NUM_PDA_ADDRS; i++) {
//printk(KERN_DEBUG "%s: trying to read PDA from 0x%08x",
// dev->name, pda_addr[i]);
res = hfa384x_from_aux(dev, pda_addr[i], PRISM2_PDA_SIZE, buf);
// if (res)
// continue;
if (res == 0 && prism2_pda_ok(buf)) {
//printk(": OK\n");
found = 1;
break;
} else {
//printk(": failed\n");
}
}
#if 0
res = hfa384x_to_aux(dev, 0x7f01be, 28, (void *)setpoint); <----new added
res = hfa384x_from_aux(dev, 0x7f01be, 28, buf); <----
newadded
#endif
prism2_enable_aux_port(dev, 0);
if (!found) {
kfree(buf);
buf = NULL;
}
return buf;
}
> > However I do not know the param0 and param1.
> > I know the starting addr of PDA is 0x7f0000.
>
> You cannot load PDA that way with volatile download.
>
> --
> Jouni Malinen PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
More information about the Hostap
mailing list