Re: ioctl
Frederic <[email protected]>
| Newsgroups | gmane.linux.drivers.ipw2100.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm sorry but no. :)
If you look at all methods in iwconfig.c for instance, you'll see that
ioctl are done through iwlib.c/iwlib.h and, finally it's just a wrapper.
It's done exactly as I have previously explained. So, I still don't
understand why I cannot get the returned value!
Fred.
Erik Slagter wrote:
> Frederic wrote:
>
>> static int ipw_get_status(struct net_device *dev, struct iwreq *wreq) {
>> struct ipw_priv *priv = ieee80211_priv(dev);
>> mutex_lock(&priv->mutex);
>> wreq->u.uparam.value = priv->status;
>> IPW_DEBUG_WX("Get status -> %d\n", wreq->u.param.value);
>> mutex_unlock(&priv->mutex);
>> return 0;
>> }
>
> You cannot access user space memory from kernel space like that.
>
> You must copy the arguments from and back to userspace using dedicated
> kernel functions/macro's. See other drivers' ioctls.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV