From: "hua xu" <xuhua18@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Problem: do_ioctl() doesn't work well on setting txpower
Date: Wed, 25 Dec 2002 17:11:36 +0000 [thread overview]
Message-ID: <F89pcnvy3JdZZzxTS2U0001dbed@hotmail.com> (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\xC7\x01and the result is \xCB\x132). 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/
reply other threads:[~2002-12-25 17:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F89pcnvy3JdZZzxTS2U0001dbed@hotmail.com \
--to=xuhua18@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®