Chinaunix首页 | 论坛 | 博客
  • 博客访问: 174177
  • 博文数量: 96
  • 博客积分: 4060
  • 博客等级: 上校
  • 技术积分: 1040
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-12 13:13
文章分类

全部博文(96)

文章存档

2011年(3)

2010年(76)

2009年(17)

我的朋友

分类: LINUX

2010-12-02 21:23:59

   static long compat_sock_ioctl(struct file *file, unsigned cmd,
                              unsigned long arg)



 int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,

                             unsigned long arg)
{
        void __user *argp = (void __user *)arg;


static int wext_ioctl_dispatch(struct net *net, struct ifreq *ifr,
                               unsigned int cmd, struct iw_request_info *info,
                               wext_ioctl_func standard,
                               wext_ioctl_func private)
{

static int wireless_process_ioctl(struct net *net, struct ifreq *ifr,
                                  unsigned int cmd,
                                  struct iw_request_info *info,
                                  wext_ioctl_func standard,
                                  wext_ioctl_func private)
{


   /* New driver API : try to find the handler */
        handler = get_handler(dev, cmd);
        if (handler) {
                /* Standard and private are not the same */
                if (cmd < SIOCIWFIRSTPRIV)     
                        return standard(dev, iwr, cmd, info, handler);
                else
                        return private(dev, iwr, cmd, info, handler);
        }


static iw_handler get_handler(struct net_device *dev, unsigned int cmd)
{              
        /* Don't "optimise" the following variable, it will crash */
        unsigned int    index;          /* *MUST* be unsigned */
       
        /* Check if we have some wireless handlers defined */
        if (dev->wireless_handlers == NULL)
                return NULL;
       
        /* Try as a standard command */
        index = cmd - SIOCIWFIRST;
        if (index < dev->wireless_handlers->num_standard)
                return dev->wireless_handlers->standard[index];

struct iw_handler_def lbs_handler_def = {
        .num_standard   = ARRAY_SIZE(lbs_handler),
        .standard       = (iw_handler *) lbs_handler,
        .get_wireless_stats = lbs_get_wireless_stats,
};


static const iw_handler lbs_handler[] = {
        (iw_handler) NULL,      /* SIOCSIWCOMMIT */
        (iw_handler) lbs_get_name,      /* SIOCGIWNAME */
        (iw_handler) NULL,      /* SIOCSIWNWID */
        (iw_handler) NULL,      /* SIOCGIWNWID */
        (iw_handler) lbs_set_freq,      /* SIOCSIWFREQ */
        (iw_handler) lbs_get_freq,      /* SIOCGIWFREQ */
        (iw_handler) lbs_set_mode,      /* SIOCSIWMODE */
        (iw_handler) lbs_get_mode,      /* SIOCGIWMODE */
        (iw_handler) NULL,      /* SIOCSIWSENS */
        (iw_handler) NULL,      /* SIOCGIWSENS */
        (iw_handler) NULL,      /* SIOCSIWRANGE */
        (iw_handler) lbs_get_range,     /* SIOCGIWRANGE */
        (iw_handler) NULL,      /* SIOCSIWPRIV */
        (iw_handler) NULL,      /* SIOCGIWPRIV */
        (iw_handler) NULL,      /* SIOCSIWSTATS */
        (iw_handler) NULL,      /* SIOCGIWSTATS */
        iw_handler_set_spy,     /* SIOCSIWSPY */
        iw_handler_get_spy,     /* SIOCGIWSPY */


阅读(426) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~