Problem: do_ioctl() doesn't work well on setting txpower

From: hua xu (xuhua18@hotmail.com)
Date: Wed Dec 25 2002 - 12:11:36 EST


       I have a problem on setting txpower in the kernel module, and I wish
to be personally CC'ed the answers/comments posted to the list in response.

       It is the first time for me to make a kernel module in order to
manage txpower.I am using Vine Linux 2.4.18-0v13 and wireless LAN card is
CISCO AIRONET 350 whose txpower can be change in 3 levels. Following is my
problem in the kernel programming.
        With CISCO LAN card, I can change the txpower by the command: iwconfig,
however, in my kernel programming, I am using do_ioctl() intending to set
txpower. There are two aspects on my problem. One aspect is that when I set
wrq.u.txpower.value which I am intended to change, and do the do_ioctl().
After complying the kernel module, the wireless LAN card just turned off
its txpower but the value is not changed. Then when I set
wrq.u.txpower.diabled trying to keep txpower on, I got the error message (I
am using $BEF(Brrno$BG(Band the result is $BK(B2). On the other hand, in my
programming, I can set bitrate without any problem and can also get the
txpower and bitrate information using do_ioctl(). I have tried to set
wrq.u.data.pointer, wrq.u.data.length, and wrq.u.data.flags and used
different values for the setting of txpower parameters, but they seemed no
effect.
         Is there any clue for solving my problem ? I would very appreciate
for any help.
         Following is the parts of my programming:

int set_txpower()
{
    int errno;
    mm_segment_t oldfs;
    struct interface_list_entry *dest_interface;
    struct net_device *dev;
    struct iwreq wrq;

      strncpy(wrq.ifr_name,dest_interface->dev->name,IFNAMSIZ);
      
        //the part of setting the tx power
                        wrq.u.txpower.value= 1;
                            wrq.u.txpower.disabled=0;
                        oldfs = get_fs();
                         set_fs(KERNEL_DS);
                         
errno=dest_interface->dev->do_ioctl(dest_interface->dev, (struct ifreq * )
&wrq,SIOCSIWTXPOW);
                         set_fs(oldfs);
                         if(errno<0)
                        { printk( "Error with SIOCSIWTXPOW\n");
                          printk("ERRNO: %d \n",errno);
                           }
                       else
                           printk("setting is OK\n\n");

      //the part of setting bitrate and it works without any problem//
        wrq.u.bitrate.value= 1;
         oldfs = get_fs();
         set_fs(KERNEL_DS);
         errno=dest_interface->dev->do_ioctl(dest_interface->dev, (struct
ifreq * ) &wrq,SIOCSIWRATE);
         set_fs(oldfs);
}

_________________________________________________________________
$B2q0wEPO?$OL5NA(B $B=<<B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!<%/%7%g%s(B
http://auction.msn.co.jp/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Dec 31 2002 - 22:00:08 EST