Commit 8e24a32e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: gdm724x: remove ioctl call

This isn't needed, userspace can trigger off of the device id if they
need to do something "special" for different devices in special modes
depending on the device's endian issues.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Won Kang <wonkang@gctsemi.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc2db2c8
......@@ -36,7 +36,6 @@
#include "hci.h"
#include "hci_packet.h"
#include "gdm_endian.h"
#include "lte_ioctl.h"
/*
* Netlink protocol number
......@@ -498,42 +497,6 @@ static struct net_device_stats *gdm_lte_stats(struct net_device *dev)
return &nic->stats;
}
static void get_dev_endian(struct data_t *data, struct net_device *dev)
{
struct nic *nic = netdev_priv(dev);
unsigned long ret;
ret = copy_to_user(data->buf, gdm_dev_endian(nic), sizeof(struct dev_endian_t));
if (ret)
netdev_info(dev, "state - failed to copy\n");
}
static int gdm_lte_ioctl_get_data(struct wm_req_t *req, struct net_device *dev)
{
u16 id = req->data_id;
switch (id) {
case GET_ENDIAN_INFO:
/* required for the user space application to find out device endian */
get_dev_endian(&req->data, dev);
break;
default:
netdev_err(dev, "ioctl - unknown type %d\n", id);
break;
}
return 0;
}
static int gdm_lte_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct wm_req_t *req = (struct wm_req_t *)ifr;
if (cmd != SIOCLTEIOCTL || req->cmd != SIOCG_DATA || req->data_id >= 100)
return -EOPNOTSUPP;
return gdm_lte_ioctl_get_data(req, dev);
}
static int gdm_lte_event_send(struct net_device *dev, char *buf, int len)
{
struct nic *nic = netdev_priv(dev);
......@@ -811,7 +774,6 @@ static struct net_device_ops gdm_netdev_ops = {
.ndo_set_config = gdm_lte_set_config,
.ndo_start_xmit = gdm_lte_tx,
.ndo_get_stats = gdm_lte_stats,
.ndo_do_ioctl = gdm_lte_ioctl,
};
static u8 gdm_lte_macaddr[ETH_ALEN] = {0x00, 0x0a, 0x3b, 0x00, 0x00, 0x00};
......
/*
* Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _LTE_IOCTL_H_
#define _LTE_IOCTL_H_
#define SIOCLTEIOCTL SIOCDEVPRIVATE
#define SIOCG_DATA 0x8D10
#define SIOCS_DATA 0x8D11
/*
* For historical reason, ioctl number and structure must be maintained
*/
enum {
LINK_ON,
LINK_OFF,
GET_NETWORK_STATICS,
RX_STOP,
RX_RESUME,
GET_DRV_VER,
GET_SDIO_DEVICE_STATUS,
GET_ENDIAN_INFO,
};
struct dev_endian_t {
unsigned char dev_endian;
unsigned char host_endian;
} __packed;
struct data_t {
long len;
void *buf;
} __packed;
struct wm_req_t {
union {
char ifrn_name[IFNAMSIZ];
} ifr_ifrn;
unsigned short cmd;
unsigned short data_id;
struct data_t data;
} __packed;
#ifndef ifr_name
#define ifr_name (ifr_ifrn.ifrm_name)
#endif
#endif /* _LTE_IOCTL_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment