Skip to contentSkip to conversation

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

DISCUSSION hua xu 1 participant 1 message Dec 25, 2002

lore
Share & tools
lore

hua xu

author
#0 lore raw

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 兎rrno�and the result is �2). 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);
}

_________________________________________________________________
会員登録は無料 充実した出品アイテムなら MSN オークション http://auction.msn.co.jp/