Re: ioctl

Erik Slagter <[email protected]>
Newsgroups gmane.linux.drivers.ipw2100.devel
Message-ID <[email protected]>
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

_______________________________________________
ipw2100-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipw2100-devel
smime.p7s (application/x-pkcs7-signature, 3.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.