亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ethtool.c

?? 網卡的驅動程序源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*******************************************************************************    Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.    This program is free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by the Free   Software Foundation; either version 2 of the License, or (at your option)   any later version.    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.    You should have received a copy of the GNU General Public License along with  this program; if not, write to the Free Software Foundation, Inc., 59   Temple Place - Suite 330, Boston, MA  02111-1307, USA.    The full GNU General Public License is included in this distribution in the  file called LICENSE.    Contact Information:  Linux NICS <linux.nics@intel.com>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************//* * net/core/ethtool.c - Ethtool ioctl handler * Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx> * * This file is where we call all the ethtool_ops commands to get * the information ethtool needs.  We fall back to calling do_ioctl() * for drivers which haven't been converted to ethtool_ops yet. * * It's GPL, stupid. * * Modification by sfeldma@pobox.com to work as backward compat * solution for pre-ethtool_ops kernels. * 	- copied struct ethtool_ops from ethtool.h * 	- defined SET_ETHTOOL_OPS * 	- put in some #ifndef NETIF_F_xxx wrappers * 	- changes refs to dev->ethtool_ops to ethtool_ops * 	- changed dev_ethtool to ethtool_ioctl *      - remove EXPORT_SYMBOL()s *      - added _kc_ prefix in built-in ethtool_op_xxx ops. */#include <linux/module.h>#include <linux/types.h>#include <linux/errno.h>#include <linux/ethtool.h>#include <linux/netdevice.h>#include <asm/uaccess.h>#undef ethtool_ops#define ethtool_ops _kc_ethtool_opsstruct _kc_ethtool_ops {	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);	int	(*set_settings)(struct net_device *, struct ethtool_cmd *);	void	(*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);	int	(*get_regs_len)(struct net_device *);	void	(*get_regs)(struct net_device *, struct ethtool_regs *, void *);	void	(*get_wol)(struct net_device *, struct ethtool_wolinfo *);	int	(*set_wol)(struct net_device *, struct ethtool_wolinfo *);	u32	(*get_msglevel)(struct net_device *);	void	(*set_msglevel)(struct net_device *, u32);	int	(*nway_reset)(struct net_device *);	u32	(*get_link)(struct net_device *);	int	(*get_eeprom_len)(struct net_device *);	int	(*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);	int	(*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);	int	(*get_coalesce)(struct net_device *, struct ethtool_coalesce *);	int	(*set_coalesce)(struct net_device *, struct ethtool_coalesce *);	void	(*get_ringparam)(struct net_device *, struct ethtool_ringparam *);	int	(*set_ringparam)(struct net_device *, struct ethtool_ringparam *);	void	(*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);	int	(*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);	u32	(*get_rx_csum)(struct net_device *);	int	(*set_rx_csum)(struct net_device *, u32);	u32	(*get_tx_csum)(struct net_device *);	int	(*set_tx_csum)(struct net_device *, u32);	u32	(*get_sg)(struct net_device *);	int	(*set_sg)(struct net_device *, u32);	u32	(*get_tso)(struct net_device *);	int	(*set_tso)(struct net_device *, u32);	int	(*self_test_count)(struct net_device *);	void	(*self_test)(struct net_device *, struct ethtool_test *, u64 *);	void	(*get_strings)(struct net_device *, u32 stringset, u8 *);	int	(*phys_id)(struct net_device *, u32);	int	(*get_stats_count)(struct net_device *);	void	(*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);} *ethtool_ops = NULL;#undef SET_ETHTOOL_OPS#define SET_ETHTOOL_OPS(netdev, ops) (ethtool_ops = (ops))	/*  * Some useful ethtool_ops methods that're device independent. * If we find that all drivers want to do the same thing here, * we can turn these into dev_() function calls. */#undef ethtool_op_get_link#define ethtool_op_get_link _kc_ethtool_op_get_linku32 _kc_ethtool_op_get_link(struct net_device *dev){	return netif_carrier_ok(dev) ? 1 : 0;}#undef ethtool_op_get_tx_csum#define ethtool_op_get_tx_csum _kc_ethtool_op_get_tx_csumu32 _kc_ethtool_op_get_tx_csum(struct net_device *dev){#ifdef NETIF_F_IP_CSUM	return (dev->features & NETIF_F_IP_CSUM) != 0;#else	return 0;#endif}#undef ethtool_op_set_tx_csum#define ethtool_op_set_tx_csum _kc_ethtool_op_set_tx_csumint _kc_ethtool_op_set_tx_csum(struct net_device *dev, u32 data){#ifdef NETIF_F_IP_CSUM	if (data)		dev->features |= NETIF_F_IP_CSUM;	else		dev->features &= ~NETIF_F_IP_CSUM;#endif	return 0;}#undef ethtool_op_get_sg#define ethtool_op_get_sg _kc_ethtool_op_get_sgu32 _kc_ethtool_op_get_sg(struct net_device *dev){#ifdef NETIF_F_SG	return (dev->features & NETIF_F_SG) != 0;#else	return 0;#endif}#undef ethtool_op_set_sg#define ethtool_op_set_sg _kc_ethtool_op_set_sgint _kc_ethtool_op_set_sg(struct net_device *dev, u32 data){#ifdef NETIF_F_SG	if (data)		dev->features |= NETIF_F_SG;	else		dev->features &= ~NETIF_F_SG;#endif	return 0;}#undef ethtool_op_get_tso#define ethtool_op_get_tso _kc_ethtool_op_get_tsou32 _kc_ethtool_op_get_tso(struct net_device *dev){#ifdef NETIF_F_TSO	return (dev->features & NETIF_F_TSO) != 0;#else	return 0;#endif}#undef ethtool_op_set_tso#define ethtool_op_set_tso _kc_ethtool_op_set_tsoint _kc_ethtool_op_set_tso(struct net_device *dev, u32 data){#ifdef NETIF_F_TSO	if (data)		dev->features |= NETIF_F_TSO;	else		dev->features &= ~NETIF_F_TSO;#endif	return 0;}/* Handlers for each ethtool command */static int ethtool_get_settings(struct net_device *dev, void *useraddr){	struct ethtool_cmd cmd = { ETHTOOL_GSET };	int err;	if (!ethtool_ops->get_settings)		return -EOPNOTSUPP;	err = ethtool_ops->get_settings(dev, &cmd);	if (err < 0)		return err;	if (copy_to_user(useraddr, &cmd, sizeof(cmd)))		return -EFAULT;	return 0;}static int ethtool_set_settings(struct net_device *dev, void *useraddr){	struct ethtool_cmd cmd;	if (!ethtool_ops->set_settings)		return -EOPNOTSUPP;	if (copy_from_user(&cmd, useraddr, sizeof(cmd)))		return -EFAULT;	return ethtool_ops->set_settings(dev, &cmd);}static int ethtool_get_drvinfo(struct net_device *dev, void *useraddr){	struct ethtool_drvinfo info;	struct ethtool_ops *ops = ethtool_ops;	if (!ops->get_drvinfo)		return -EOPNOTSUPP;	memset(&info, 0, sizeof(info));	info.cmd = ETHTOOL_GDRVINFO;	ops->get_drvinfo(dev, &info);	if (ops->self_test_count)		info.testinfo_len = ops->self_test_count(dev);	if (ops->get_stats_count)		info.n_stats = ops->get_stats_count(dev);	if (ops->get_regs_len)		info.regdump_len = ops->get_regs_len(dev);	if (ops->get_eeprom_len)		info.eedump_len = ops->get_eeprom_len(dev);	if (copy_to_user(useraddr, &info, sizeof(info)))		return -EFAULT;	return 0;}static int ethtool_get_regs(struct net_device *dev, char *useraddr){	struct ethtool_regs regs;	struct ethtool_ops *ops = ethtool_ops;	void *regbuf;	int reglen, ret;	if (!ops->get_regs || !ops->get_regs_len)		return -EOPNOTSUPP;	if (copy_from_user(&regs, useraddr, sizeof(regs)))		return -EFAULT;	reglen = ops->get_regs_len(dev);	if (regs.len > reglen)		regs.len = reglen;	regbuf = kmalloc(reglen, GFP_USER);	if (!regbuf)		return -ENOMEM;	ops->get_regs(dev, &regs, regbuf);	ret = -EFAULT;	if (copy_to_user(useraddr, &regs, sizeof(regs)))		goto out;	useraddr += offsetof(struct ethtool_regs, data);	if (copy_to_user(useraddr, regbuf, reglen))		goto out;	ret = 0; out:	kfree(regbuf);	return ret;}static int ethtool_get_wol(struct net_device *dev, char *useraddr){	struct ethtool_wolinfo wol = { ETHTOOL_GWOL };	if (!ethtool_ops->get_wol)		return -EOPNOTSUPP;	ethtool_ops->get_wol(dev, &wol);	if (copy_to_user(useraddr, &wol, sizeof(wol)))		return -EFAULT;	return 0;}static int ethtool_set_wol(struct net_device *dev, char *useraddr){	struct ethtool_wolinfo wol;	if (!ethtool_ops->set_wol)		return -EOPNOTSUPP;	if (copy_from_user(&wol, useraddr, sizeof(wol)))		return -EFAULT;	return ethtool_ops->set_wol(dev, &wol);}static int ethtool_get_msglevel(struct net_device *dev, char *useraddr){	struct ethtool_value edata = { ETHTOOL_GMSGLVL };	if (!ethtool_ops->get_msglevel)		return -EOPNOTSUPP;	edata.data = ethtool_ops->get_msglevel(dev);	if (copy_to_user(useraddr, &edata, sizeof(edata)))		return -EFAULT;	return 0;}static int ethtool_set_msglevel(struct net_device *dev, char *useraddr){	struct ethtool_value edata;	if (!ethtool_ops->set_msglevel)		return -EOPNOTSUPP;	if (copy_from_user(&edata, useraddr, sizeof(edata)))		return -EFAULT;	ethtool_ops->set_msglevel(dev, edata.data);	return 0;}static int ethtool_nway_reset(struct net_device *dev){	if (!ethtool_ops->nway_reset)		return -EOPNOTSUPP;	return ethtool_ops->nway_reset(dev);}static int ethtool_get_link(struct net_device *dev, void *useraddr){	struct ethtool_value edata = { ETHTOOL_GLINK };	if (!ethtool_ops->get_link)		return -EOPNOTSUPP;	edata.data = ethtool_ops->get_link(dev);	if (copy_to_user(useraddr, &edata, sizeof(edata)))		return -EFAULT;	return 0;}static int ethtool_get_eeprom(struct net_device *dev, void *useraddr){	struct ethtool_eeprom eeprom;	struct ethtool_ops *ops = ethtool_ops;	u8 *data;	int ret;	if (!ops->get_eeprom || !ops->get_eeprom_len)		return -EOPNOTSUPP;	if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))		return -EFAULT;	/* Check for wrap and zero */	if (eeprom.offset + eeprom.len <= eeprom.offset)		return -EINVAL;	/* Check for exceeding total eeprom len */	if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))		return -EINVAL;	data = kmalloc(eeprom.len, GFP_USER);	if (!data)		return -ENOMEM;	ret = -EFAULT;	if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))		goto out;	ret = ops->get_eeprom(dev, &eeprom, data);	if (ret)		goto out;	ret = -EFAULT;	if (copy_to_user(useraddr, &eeprom, sizeof(eeprom)))		goto out;	if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))		goto out;	ret = 0; out:	kfree(data);	return ret;}static int ethtool_set_eeprom(struct net_device *dev, void *useraddr){	struct ethtool_eeprom eeprom;	struct ethtool_ops *ops = ethtool_ops;	u8 *data;	int ret;	if (!ops->set_eeprom || !ops->get_eeprom_len)		return -EOPNOTSUPP;	if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))		return -EFAULT;	/* Check for wrap and zero */	if (eeprom.offset + eeprom.len <= eeprom.offset)		return -EINVAL;	/* Check for exceeding total eeprom len */	if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))		return -EINVAL;	data = kmalloc(eeprom.len, GFP_USER);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产美国国产综合一区二区| 美女一区二区三区| 三级一区在线视频先锋| 国产不卡视频在线播放| 欧美偷拍一区二区| 欧美—级在线免费片| 婷婷综合久久一区二区三区| 99精品国产视频| 日韩精品中文字幕一区二区三区| 亚洲欧美激情小说另类| 国产剧情av麻豆香蕉精品| 欧美高清性hdvideosex| 18欧美乱大交hd1984| 国产一区中文字幕| 91精品国产乱码久久蜜臀| 中文字幕亚洲精品在线观看| 国产精品白丝av| 日韩视频免费观看高清完整版在线观看| 国产精品污网站| 国产精品一区二区免费不卡| 日韩一区二区精品葵司在线| 日韩高清不卡一区| 欧美老女人第四色| 亚洲午夜激情网站| 欧美影院精品一区| 一区二区三区不卡在线观看| 成人18精品视频| 日本一区二区成人| 成人国产在线观看| 国产精品私人影院| 不卡一区在线观看| 国产精品久久久久久久久图文区 | 国产精品视频一二| 国产精品自拍毛片| 欧美国产综合色视频| 国产麻豆精品久久一二三| 26uuu另类欧美| 国产美女一区二区三区| 2021久久国产精品不只是精品| 天天操天天综合网| 91精品国产乱| 国产精品资源在线看| 久久久精品日韩欧美| 成人精品一区二区三区四区 | 国产激情一区二区三区四区| 久久久欧美精品sm网站| www.日韩av| 夜夜操天天操亚洲| 91精品麻豆日日躁夜夜躁| 麻豆91小视频| 久久久青草青青国产亚洲免观| 成人激情免费电影网址| 亚洲男人的天堂在线aⅴ视频| 欧美日韩在线不卡| 日韩高清在线一区| 夜夜揉揉日日人人青青一国产精品 | av资源网一区| 一区二区欧美在线观看| 91精品国模一区二区三区| 激情综合网天天干| 国产精品久久久久久久岛一牛影视 | 5月丁香婷婷综合| 国产精品一二一区| 一区二区三区美女| 日韩精品一区二区三区视频 | 欧美日韩不卡视频| 国产露脸91国语对白| 日韩理论片中文av| 欧美大片国产精品| 91色婷婷久久久久合中文| 亚洲va韩国va欧美va精品| 精品第一国产综合精品aⅴ| 不卡视频一二三四| 美女被吸乳得到大胸91| 国产精品区一区二区三区| 欧美视频你懂的| 国产一区激情在线| 日韩中文欧美在线| 国产精品系列在线| 欧美变态tickle挠乳网站| 91久久精品网| 国产ts人妖一区二区| 日韩精品一区第一页| 国产精品久久久久永久免费观看| 欧美一区二区三区免费视频| 91麻豆精品在线观看| 国产伦精品一区二区三区在线观看| 亚洲一区在线观看视频| 国产精品乱人伦一区二区| 日韩网站在线看片你懂的| 欧美色网一区二区| 91视频com| av不卡一区二区三区| 欧美丰满少妇xxxbbb| aaa国产一区| 国产成人亚洲精品青草天美| 理论电影国产精品| 亚洲国产成人91porn| 一区二区三区毛片| 亚洲男人的天堂在线观看| 国产精品另类一区| 久久久久久久久久久久久女国产乱| 欧美日韩国产美| 欧美视频在线一区| 色悠悠久久综合| 99re66热这里只有精品3直播 | 激情图片小说一区| 日产欧产美韩系列久久99| 亚洲高清在线精品| 香蕉成人伊视频在线观看| 一区二区三区中文在线| 亚洲美女精品一区| 亚洲欧美日韩小说| 一区二区三区电影在线播| 一区二区三区日韩在线观看| 亚洲黄一区二区三区| 亚洲精品免费一二三区| 一区二区三区中文字幕电影| 亚洲一区二区三区精品在线| 一区二区三区四区在线免费观看| 亚洲伦在线观看| 亚洲一区影音先锋| 亚洲综合成人在线| 亚洲国产成人高清精品| 视频一区二区三区中文字幕| 91在线视频免费91| 欧洲国内综合视频| 欧美美女视频在线观看| 911精品国产一区二区在线| 日韩视频在线永久播放| 精品1区2区在线观看| 国产色产综合产在线视频 | 精品日韩成人av| 国产天堂亚洲国产碰碰| 亚洲色大成网站www久久九九| 亚洲免费观看高清完整版在线 | 亚洲男人的天堂av| 视频一区二区欧美| 国产成人精品亚洲午夜麻豆| 91亚洲精品乱码久久久久久蜜桃| 欧美性色aⅴ视频一区日韩精品| 欧美精品久久一区| 欧美成人欧美edvon| 中文字幕视频一区| 日韩va亚洲va欧美va久久| 国产经典欧美精品| 欧美主播一区二区三区| 欧美美女一区二区| 国产精品美女久久久久av爽李琼| 亚洲综合色成人| 国产高清精品在线| 欧美精品三级在线观看| 国产日韩精品一区| 同产精品九九九| 91在线看国产| 精品国产伦一区二区三区观看体验 | 国产色综合久久| 天天综合天天做天天综合| 国产a区久久久| 欧美一区二区私人影院日本| 日本一区二区免费在线观看视频| 亚洲精品亚洲人成人网| 国产一区二区美女| 欧美日韩国产一级二级| 国产精品视频一二| 国产综合久久久久久鬼色| 精品视频一区三区九区| 中国av一区二区三区| 久久精品免费观看| 欧美日韩一区小说| 中文字幕色av一区二区三区| 精品一区在线看| 欧美伦理电影网| 亚洲九九爱视频| 国产91精品一区二区麻豆亚洲| 日韩一区二区在线观看视频| 一片黄亚洲嫩模| 成人性生交大片免费看在线播放| 欧美一级欧美三级在线观看| 亚洲女女做受ⅹxx高潮| 成人毛片在线观看| 久久综合九色综合97_久久久| 婷婷中文字幕一区三区| 欧美亚一区二区| 亚洲人一二三区| 97久久超碰国产精品| 国产日韩欧美不卡在线| 国产在线精品一区二区三区不卡| 91精品国产日韩91久久久久久| 亚洲一卡二卡三卡四卡无卡久久| 99精品在线观看视频| 国产日韩精品一区| 成人h精品动漫一区二区三区| 久久影院电视剧免费观看| 九九国产精品视频| 精品国产成人系列| 精品一区二区三区蜜桃| 日韩精品中午字幕| 久久精品国产免费| 精品国产一区久久|