->ifr_data users annotated.
static void ether1394_iso(struct hpsb_iso *iso);
static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr);
+static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr);
static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
quadlet_t *data, u64 addr, size_t len, u16 flags);
{
switch(cmd) {
case SIOCETHTOOL:
- return ether1394_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+ return ether1394_ethtool_ioctl(dev, ifr->ifr_data);
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
case SIOCGMIIREG: /* Read MII PHY register. */
return 0;
}
-static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
u32 ethcmd;
- if (get_user(ethcmd, (u32 *)useraddr))
+ if (get_user(ethcmd, (u32 __user *)useraddr))
return -EFAULT;
switch (ethcmd) {
*/
static int
-netdev_ethtool_ioctl (struct net_device *dev, void *useraddr)
+netdev_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
{
u32 ethcmd;
struct el3_private *lp = netdev_priv(dev);
/* dev_ioctl() in ../../net/core/dev.c has already checked
capable(CAP_NET_ADMIN), so don't bother with that here. */
- if (get_user(ethcmd, (u32 *)useraddr))
+ if (get_user(ethcmd, (u32 __user *)useraddr))
return -EFAULT;
switch (ethcmd) {
switch (cmd) {
case SIOCETHTOOL:
- rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
break;
default:
This function handles all the ethtool ioctls. It gives driver info, gets/sets driver speed, gets memory mapped register values, forces auto negotiation, sets/gets WOL options for ethtool application.
*/
-static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
+static int amd8111e_ethtool_ioctl(struct net_device* dev, void __user *useraddr)
{
struct amd8111e_priv *lp = netdev_priv(dev);
struct pci_dev *pci_dev = lp->pci_dev;
switch(cmd) {
case SIOCETHTOOL:
- return amd8111e_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+ return amd8111e_ethtool_ioctl(dev, ifr->ifr_data);
case SIOCGMIIPHY:
data->phy_id = PHY_ID;
static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr)
{
struct ethtool_drvinfo info;
- void *addr = ifr->ifr_data;
+ void __user *addr = ifr->ifr_data;
uint32_t cmd;
- if (get_user(cmd, (uint32_t *)addr)) {
+ if (get_user(cmd, (uint32_t __user *)addr)) {
return -EFAULT;
}
static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
{
struct net_device *slave_dev = NULL;
- struct ifbond *u_binfo = NULL, k_binfo;
- struct ifslave *u_sinfo = NULL, k_sinfo;
+ struct ifbond k_binfo;
+ struct ifbond __user *u_binfo = NULL;
+ struct ifslave k_sinfo;
+ struct ifslave __user *u_sinfo = NULL;
struct mii_ioctl_data *mii = NULL;
int prev_abi_ver = orig_app_abi_ver;
int res = 0;
return 0;
case BOND_INFO_QUERY_OLD:
case SIOCBONDINFOQUERY:
- u_binfo = (struct ifbond *)ifr->ifr_data;
+ u_binfo = (struct ifbond __user *)ifr->ifr_data;
if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) {
return -EFAULT;
return res;
case BOND_SLAVE_INFO_QUERY_OLD:
case SIOCBONDSLAVEINFOQUERY:
- u_sinfo = (struct ifslave *)ifr->ifr_data;
+ u_sinfo = (struct ifslave __user *)ifr->ifr_data;
if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave))) {
return -EFAULT;
static void set_multicast (struct net_device *dev);
static struct net_device_stats *get_stats (struct net_device *dev);
static int clear_stats (struct net_device *dev);
-static int rio_ethtool_ioctl (struct net_device *dev, void *useraddr);
+static int rio_ethtool_ioctl (struct net_device *dev, void __user *useraddr);
static int rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
static int rio_close (struct net_device *dev);
static int find_miiphy (struct net_device *dev);
}
static int
-rio_ethtool_ioctl (struct net_device *dev, void *useraddr)
+rio_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
{
struct netdev_private *np = dev->priv;
u32 ethcmd;
phy_addr = np->phy_addr;
switch (cmd) {
case SIOCETHTOOL:
- return rio_ethtool_ioctl (dev, (void *) rq->ifr_data);
+ return rio_ethtool_ioctl(dev, rq->ifr_data);
case SIOCDEVPRIVATE:
break;
return &sp->stats;
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
u32 ethcmd;
struct speedo_private *sp = netdev_priv(dev);
pci_set_power_state(sp->pdev, saved_acpi);
return 0;
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return netdev_ethtool_ioctl(dev, rq->ifr_data);
default:
return -EOPNOTSUPP;
}
return status; /* return the device name string */
}
-static int ewrk3_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
u_long iobase = dev->base_addr;
u32 ethcmd;
- if (get_user(ethcmd, (u32 *)useraddr))
+ if (get_user(ethcmd, (u32 __user *)useraddr))
return -EFAULT;
switch (ethcmd) {
/* ethtool IOCTLs are handled elsewhere */
if (cmd == SIOCETHTOOL)
- return ewrk3_ethtool_ioctl(dev, (void *)rq->ifr_data);
+ return ewrk3_ethtool_ioctl(dev, rq->ifr_data);
/* Other than ethtool, all we handle are private IOCTLs */
if (cmd != EWRK3IOCTL)
return &np->stats;
}
-static int nv_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int nv_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct fe_priv *np = get_nvpriv(dev);
u8 *base = get_hwbase(dev);
{
switch(cmd) {
case SIOCETHTOOL:
- return nv_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return nv_ethtool_ioctl(dev, rq->ifr_data);
default:
return -EOPNOTSUPP;
}
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct hamachi_private *np = dev->priv;
u32 ethcmd;
return -EINVAL;
if (cmd == SIOCETHTOOL)
- rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
else if (cmd == (SIOCDEVPRIVATE+3)) { /* set rx,tx intr params */
u32 *d = (u32 *)&rq->ifr_data;
*/
static int bpq_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
- struct bpq_ethaddr *ethaddr = (struct bpq_ethaddr *)ifr->ifr_data;
+ struct bpq_ethaddr __user *ethaddr = ifr->ifr_data;
struct bpqdev *bpq = dev->priv;
struct bpq_req req;
struct scc_mem_config memcfg;
struct scc_hw_config hwcfg;
struct scc_calibrate cal;
- struct scc_channel *scc;
+ struct scc_channel *scc = (struct scc_channel *) dev->priv;
int chan;
unsigned char device_name[IFNAMSIZ];
- void *arg;
+ void __user *arg = ifr->ifr_data;
- scc = (struct scc_channel *) dev->priv;
- arg = (void *) ifr->ifr_data;
if (!Driver_Initialized)
{
static int
ixgb_ethtool_seeprom(struct ixgb_adapter *adapter,
- struct ethtool_eeprom *eeprom, void *user_data)
+ struct ethtool_eeprom *eeprom, void __user *user_data)
{
struct ixgb_hw *hw = &adapter->hw;
uint16_t eeprom_buff[256];
int ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
{
struct ixgb_adapter *adapter = netdev->priv;
- void *addr = ifr->ifr_data;
+ void __user *addr = ifr->ifr_data;
uint32_t cmd;
- if (get_user(cmd, (uint32_t *) addr))
+ if (get_user(cmd, (uint32_t __user *) addr))
return -EFAULT;
switch (cmd) {
spin_unlock_irq(&np->lock);
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct netdev_private *np = dev->priv;
u32 cmd;
- if (get_user(cmd, (u32 *)useraddr))
+ if (get_user(cmd, (u32 __user *)useraddr))
return -EFAULT;
switch (cmd) {
switch(cmd) {
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return netdev_ethtool_ioctl(dev, rq->ifr_data);
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
case SIOCDEVPRIVATE: /* for binary compat, remove in 2.5 */
data->phy_id = 1;
return &dev->stats;
}
-static int ns83820_ethtool_ioctl (struct ns83820 *dev, void *useraddr)
+static int ns83820_ethtool_ioctl (struct ns83820 *dev, void __user *useraddr)
{
u32 ethcmd;
switch(cmd) {
case SIOCETHTOOL:
- return ns83820_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return ns83820_ethtool_ioctl(dev, rq->ifr_data);
default:
return -EOPNOTSUPP;
return 0;
}
-static int smc_ethtool_ioctl (struct net_device *dev, void *useraddr)
+static int smc_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
{
u32 ethcmd;
struct smc_private *smc = netdev_priv(dev);
- if (get_user(ethcmd, (u32 *)useraddr))
+ if (get_user(ethcmd, (u32 __user *)useraddr))
return -EFAULT;
switch (ethcmd) {
case SIOCETHTOOL:
saved_bank = inw(ioaddr + BANK_SELECT);
SMC_SELECT_BANK(3);
- rc = smc_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ rc = smc_ethtool_ioctl(dev, rq->ifr_data);
SMC_SELECT_BANK(saved_bank);
break;
return error;
case SIOCRRID:
- return put_user(0x52523032, (int *)(&rq->ifr_data[0]));
+ return put_user(0x52523032, (int __user *)rq->ifr_data);
default:
return error;
}
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct ethtool_cmd ecmd;
struct netdev_private *np = dev->priv;
return -EINVAL;
if (cmd == SIOCETHTOOL)
- rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
else {
spin_lock_irq(&np->lock);
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct netdev_private *np = dev->priv;
u32 ethcmd;
return -EINVAL;
if (cmd == SIOCETHTOOL)
- rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
else {
spin_lock_irq(&np->lock);
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct tulip_private *np = netdev_priv(dev);
u32 ethcmd;
switch (cmd) {
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return netdev_ethtool_ioctl(dev, rq->ifr_data);
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
if (tp->mii_cnt)
}
-static int xircom_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct ethtool_cmd ecmd;
struct xircom_private *tp = dev->priv;
switch(cmd) {
case SIOCETHTOOL:
- return xircom_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return xircom_ethtool_ioctl(dev, rq->ifr_data);
/* Legacy mii-diag interface */
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
}
static inline int
-typhoon_ethtool_ioctl(struct net_device *dev, void *useraddr)
+typhoon_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct typhoon *tp = (struct typhoon *) dev->priv;
u32 ethcmd;
{
switch (cmd) {
case SIOCETHTOOL:
- return typhoon_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+ return typhoon_ethtool_ioctl(dev, ifr->ifr_data);
default:
break;
}
return(ret);
}
-static int dlci_config(struct net_device *dev, struct dlci_conf *conf, int get)
+static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, int get)
{
struct dlci_conf config;
struct dlci_local *dlp;
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
- return(dlci_config(dev, (struct dlci_conf *) ifr->ifr_data, cmd == DLCI_GET_CONF));
+ return(dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF));
break;
default:
return(0);
}
-static int sdla_config(struct net_device *dev, struct frad_conf *conf, int get)
+static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get)
{
struct frad_local *flp;
struct conf_data data;
return(0);
}
-static int sdla_xfer(struct net_device *dev, struct sdla_mem *info, int read)
+static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read)
{
struct sdla_mem mem;
char *temp;
{
case FRAD_GET_CONF:
case FRAD_SET_CONF:
- return(sdla_config(dev, (struct frad_conf *)ifr->ifr_data, cmd == FRAD_GET_CONF));
+ return(sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF));
case SDLA_IDENTIFY:
ifr->ifr_flags = flp->type;
case SDLA_WRITEMEM:
case SDLA_READMEM:
- return(sdla_xfer(dev, (struct sdla_mem *)ifr->ifr_data, cmd == SDLA_READMEM));
+ return(sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM));
case SDLA_START:
sdla_start(dev);
#endif /* HISTOGRAM */
static inline int
-wl_netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+wl_netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
u32 ethcmd;
switch(cmd)
{
case SIOCETHTOOL:
- ret = wl_netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ ret = wl_netdev_ethtool_ioctl(dev, rq->ifr_data);
break;
/* ------------------- OTHER IOCTL ------------------- */
return wstats;
}
-static inline int wl3501_ethtool_ioctl(struct net_device *dev, void *uaddr)
+static inline int wl3501_ethtool_ioctl(struct net_device *dev, void __user *uaddr)
{
u32 ethcmd;
int rc = -EFAULT;
if (netif_device_present(dev)) {
rc = -EOPNOTSUPP;
if (cmd == SIOCETHTOOL)
- rc = wl3501_ethtool_ioctl(dev, (void *)rq->ifr_data);
+ rc = wl3501_ethtool_ioctl(dev, rq->ifr_data);
}
return rc;
}
outw(cfg_value | 0x1000, ioaddr + Cnfg);
}
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{
struct yellowfin_private *np = dev->priv;
u32 ethcmd;
switch(cmd) {
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+ return netdev_ethtool_ioctl(dev, rq->ifr_data);
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
data->phy_id = np->phys[0] & 0x1f;
/* Fall Through */
return &((struct eth_dev *) net->priv)->stats;
}
-static int eth_ethtool_ioctl (struct net_device *net, void *useraddr)
+static int eth_ethtool_ioctl (struct net_device *net, void __user *useraddr)
{
struct eth_dev *dev = (struct eth_dev *) net->priv;
u32 cmd;
- if (get_user (cmd, (u32 *)useraddr))
+ if (get_user (cmd, (u32 __user *)useraddr))
return -EFAULT;
switch (cmd) {
{
switch (cmd) {
case SIOCETHTOOL:
- return eth_ethtool_ioctl (net, (void *)rq->ifr_data);
+ return eth_ethtool_ioctl(net, rq->ifr_data);
default:
return -EOPNOTSUPP;
}
struct catc *catc = dev->priv;
u32 cmd;
- if (get_user(cmd, (u32 *)useraddr))
+ if (get_user(cmd, (u32 __user *)useraddr))
return -EFAULT;
switch (cmd) {
{
switch(cmd) {
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(dev, (void __user *)rq->ifr_data);
+ return netdev_ethtool_ioctl(dev, rq->ifr_data);
default:
return -EOPNOTSUPP;
}
{
switch (cmd) {
case SIOCETHTOOL:
- return netdev_ethtool_ioctl(net, (void __user *)rq->ifr_data);
+ return netdev_ethtool_ioctl(net, rq->ifr_data);
}
return -EOPNOTSUPP;
}
switch (cmd) {
case SIOCETHTOOL:
- res = pegasus_ethtool_ioctl(net, (void __user *)rq->ifr_data);
+ res = pegasus_ethtool_ioctl(net, rq->ifr_data);
break;
case SIOCDEVPRIVATE:
data[0] = pegasus->phy;
return res;
}
-static int rtl8150_ethtool_ioctl(struct net_device *netdev, void *uaddr)
+static int rtl8150_ethtool_ioctl(struct net_device *netdev, void __user *uaddr)
{
rtl8150_t *dev;
int cmd;
dev = netdev->priv;
- if (get_user(cmd, (int *) uaddr))
+ if (get_user(cmd, (int __user *) uaddr))
return -EFAULT;
switch (cmd) {
struct ifmap ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
- char __user * ifru_data;
+ void __user * ifru_data;
struct if_settings ifru_settings;
} ifr_ifru;
};