/* $OpenBSD: if_urtw.c,v 1.23 2009/06/24 01:07:12 martynas Exp $ */
/*-
* Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org>
* Copyright (c) 2008 Weongyo Jeong <weongyo@FreeBSD.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/bsdtypes.h>
#include "BSD_USB_Adaptor.h"
#include "bpfilter.h"
#include <sys/param.h>
#include <sys/sockio.h>
#include <sys/proc.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/timeout.h>
#include <sys/conf.h>
#include <sys/device.h>
//#include <machine/bus.h>
//#include <machine/endian.h>
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <netinet/in.h>
//#include <netinet/in_systm.h>
//#include <netinet/in_var.h>
#include <netinet/if_ether.h>
//#include <netinet/ip.h>
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_radiotap.h>
//#include <dev/usb/usb.h>
//#include <dev/usb/usbdi.h>
//#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbdevs.h>
#include <if_urtwreg.h>
#ifdef USB_DEBUG
#define URTW_DEBUG
#endif
#define URTW_DEBUG 1
#ifdef URTW_DEBUG
#define DPRINTF(x) do { if (urtw_debug) printf x; } while (0)
#define DPRINTFN(n, x) do { if (urtw_debug >= (n)) printf x; } while (0)
int urtw_debug = 0;
#else
#define DPRINTF(x)
#define DPRINTFN(n, x)
#endif
/*
* Recognized device vendors/products.
*/
static const struct urtw_type {
struct usb_devno dev;
uint8_t rev;
} urtw_devs[] = {
#define URTW_DEV_RTL8187(v, p) \
{ { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, URTW_HWREV_8187 }
#define URTW_DEV_RTL8187B(v, p) \
{ { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, URTW_HWREV_8187B }
/* Realtek RTL8187 devices. */
URTW_DEV_RTL8187(DICKSMITH, RTL8187),
URTW_DEV_RTL8187(LOGITEC, RTL8187),
URTW_DEV_RTL8187(NETGEAR, WG111V2),
URTW_DEV_RTL8187(REALTEK, RTL8187),
URTW_DEV_RTL8187(SPHAIRON, RTL8187),
URTW_DEV_RTL8187(SURECOM, EP9001G2A),
/* Realtek RTL8187B devices. */
URTW_DEV_RTL8187B(BELKIN, F5D7050E),
URTW_DEV_RTL8187B(NETGEAR, WG111V3),
URTW_DEV_RTL8187B(REALTEK, RTL8187B_0),
URTW_DEV_RTL8187B(REALTEK, RTL8187B_1),
URTW_DEV_RTL8187B(REALTEK, RTL8187B_2)
//URTW_DEV_RTL8187B(SITECOMEU, WL168)
#undef URTW_DEV_RTL8187
#undef URTW_DEV_RTL8187B
};
#define urtw_lookup(v, p) \
((const struct urtw_type *)usb_lookup(urtw_devs, v, p))
/*
* Helper read/write macros.
*/
#define urtw_read8_m(sc, val, data) do { \
error = urtw_read8_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_read8_idx_m(sc, val, data, idx) do { \
error = urtw_read8_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write8_m(sc, val, data) do { \
error = urtw_write8_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write8_idx_m(sc, val, data, idx) do { \
error = urtw_write8_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_read16_m(sc, val, data) do { \
error = urtw_read16_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_read16_idx_m(sc, val, data, idx) do { \
error = urtw_read16_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write16_m(sc, val, data) do { \
error = urtw_write16_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write16_idx_m(sc, val, data, idx) do { \
error = urtw_write16_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_read32_m(sc, val, data) do { \
error = urtw_read32_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_read32_idx_m(sc, val, data, idx) do { \
error = urtw_read32_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write32_m(sc, val, data) do { \
error = urtw_write32_c(sc, val, data, 0); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_write32_idx_m(sc, val, data, idx) do { \
error = urtw_write32_c(sc, val, data, idx); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_8187_write_phy_ofdm(sc, val, data) do { \
error = urtw_8187_write_phy_ofdm_c(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_8187_write_phy_cck(sc, val, data) do { \
error = urtw_8187_write_phy_cck_c(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
#define urtw_8225_write(sc, val, data) do { \
error = urtw_8225_write_c(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
struct urtw_pair {
uint32_t reg;
uint32_t val;
};
struct urtw_pair_idx {
uint8_t reg;
uint8_t val;
uint8_t idx;
};
static struct urtw_pair_idx urtw_8187b_regtbl[] = {
{ 0xf0, 0x32, 0 }, { 0xf1, 0x32, 0 }, { 0xf2, 0x00, 0 },
{ 0xf3, 0x00, 0 }, { 0xf4, 0x32, 0 }, { 0xf5, 0x43, 0 },
{ 0xf6, 0x00, 0 }, { 0xf7, 0x00, 0 }, { 0xf8, 0x46, 0 },
{ 0xf9, 0xa4, 0 }, { 0xfa, 0x00, 0 }, { 0xfb, 0x00, 0 },
{ 0xfc, 0x96, 0 }, { 0xfd, 0xa4, 0 }, { 0xfe, 0x00, 0 },
{ 0xff, 0x00, 0 },
{ 0x58, 0x4b, 1 }, { 0x59, 0x00, 1 }, { 0x5a, 0x4b, 1 },
{ 0x5b, 0x00, 1 }, { 0x60, 0x4b, 1 }, { 0x61, 0x09, 1 },
{ 0x62, 0x4b, 1 }, { 0x63, 0x09, 1 }, { 0xce, 0x0f, 1 },
{ 0xcf, 0x00, 1 }, { 0xe0, 0xff, 1 }, { 0xe1, 0x0f, 1 },
{ 0xe2, 0x00, 1 }, { 0xf0, 0x4e, 1 }, { 0xf1, 0x01, 1 },
{ 0xf2, 0x02, 1 }, { 0xf3, 0x03, 1 }, { 0xf4, 0x04, 1 },
{ 0xf5, 0x05, 1 }, { 0xf6, 0x06, 1 }, { 0xf7, 0x07, 1 },
{ 0xf8, 0x08, 1 },
{ 0x4e, 0x00, 2 }, { 0x0c, 0x04, 2 }, { 0x21, 0x61, 2 },
{ 0x22, 0x68, 2 }, { 0x23, 0x6f, 2 }, { 0x24, 0x76, 2 },
{ 0x25, 0x7d, 2 }, { 0x26, 0x84, 2 }, { 0x27, 0x8d, 2 },
{ 0x4d, 0x08, 2 }, { 0x50, 0x05, 2 }, { 0x51, 0xf5, 2 },
{ 0x52, 0x04, 2 }, { 0x53, 0xa0, 2 }, { 0x54, 0x1f, 2 },
{ 0x55, 0x23, 2 }, { 0x56, 0x45, 2 }, { 0x57, 0x67, 2 },
{ 0x58, 0x08, 2 }, { 0x59, 0x08, 2 },
没有合适的资源?快使用搜索试试~ 我知道了~
电子线路CAD元件库素材文件
共4776个文件
intlib:1056个
c:513个
pcblib:496个
需积分: 48 8 下载量 20 浏览量
2022-04-19
10:09:54
上传
评论
收藏 276.98MB ZIP 举报
温馨提示
电子线路CAD元件库素材文件
资源详情
资源评论
资源推荐
收起资源包目录
电子线路CAD元件库素材文件 (4776个子文件)
en-US.aff 3KB
GENERIC_LIB.AL 43KB
IEEE.AL 5KB
IEEE.AL 5KB
GENERIC.AN 7.3MB
std_logic_entities.AN 797KB
std_logic_entities.AN 794KB
vital_primitives.AN 480KB
vital_primitives.AN 477KB
numeric_std.AN 351KB
numeric_std.AN 349KB
numeric_bit.AN 215KB
numeric_bit.AN 212KB
std_logic_arith.AN 183KB
std_logic_arith.AN 181KB
vital_timing.AN 125KB
vital_timing.AN 122KB
mathpack.AN 107KB
std_logic_textio.AN 107KB
std_logic_textio.AN 101KB
std_logic_1164.AN 94KB
std_logic_1164.AN 92KB
std_logic_misc.AN 80KB
std_logic_misc.AN 77KB
std_logic_components.AN 61KB
std_logic_components.AN 59KB
std_logic_signed.AN 35KB
std_logic_unsigned.AN 34KB
std_logic_signed.AN 33KB
std_logic_unsigned.AN 31KB
cstart.asm 6KB
cstart.asm 4KB
cstart.asm 3KB
cstart.asm 3KB
u_parts.BAK 2KB
NB2DSK01.08.bmp 1.29MB
NB2DSK01.07.bmp 1.29MB
NB3000XN.05.bmp 1.14MB
NB3000AL.02.bmp 1.14MB
NB3000LC.02.bmp 1.14MB
NB3000XN.03.bmp 1.14MB
NB3000XN.02.bmp 1.14MB
NB3000XN.04.bmp 1.14MB
PB01.07.bmp 230KB
PB30.01.bmp 207KB
DB41.02.bmp 190KB
DB42.02.bmp 190KB
DB43.02.bmp 190KB
DB40.02.bmp 190KB
DB46.02.bmp 189KB
DB30.04.bmp 189KB
DB38.01.bmp 189KB
DB30.06.bmp 189KB
DB41.01.bmp 189KB
DB32.07.bmp 189KB
DB31.06.bmp 189KB
DB37.01.bmp 189KB
DB31.04.bmp 189KB
DB36.01.bmp 189KB
DB42.01.bmp 189KB
DB32.05.bmp 189KB
TSK52A_D_About.bmp 183KB
IOB_About.bmp 183KB
Digital_IO_About.bmp 183KB
LPC2800_About.bmp 183KB
TSK51D_About.bmp 183KB
Memory_Instrument_About.bmp 183KB
LPC2400_About.bmp 183KB
LA16_About.bmp 183KB
TSK165B_D_About.bmp 183KB
IOB_4X8_About.bmp 183KB
CLKGEN_About.bmp 183KB
LAX_1K8__About.bmp 183KB
TSK165A_About.bmp 183KB
TSK52B_W_About.bmp 183KB
IOB_2X8_About.bmp 183KB
TSK80B_WD_About.bmp 183KB
Crosspoint_Switch_About.bmp 183KB
IOB_1X16_About.bmp 183KB
CustomInstrument_About.bmp 183KB
LPC2000_About.bmp 183KB
LAX8_About.bmp 183KB
TSK165D_About.bmp 183KB
TSK52B_WD_About.bmp 183KB
TSK80C_WD_About.bmp 183KB
Generic_About.bmp 183KB
IOB_4X16_About.bmp 183KB
LAX_2K8__About.bmp 183KB
IOB_1X8_About.bmp 183KB
TSK165_About.bmp 183KB
TSK51A_About.bmp 183KB
TSK165B_About.bmp 183KB
JTAG_CONTROLLER_About.bmp 183KB
Nanoboard-NB1_About.bmp 183KB
TSK80B_W_About.bmp 183KB
TSK3000_About.BMP 183KB
LAX_4K8__About.bmp 183KB
LPC2200_About.bmp 183KB
TSK51_About.bmp 183KB
FRQCNT2_About.bmp 183KB
共 4776 条
- 1
- 2
- 3
- 4
- 5
- 6
- 48
友weixin_MAO
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 软考高项2008-2023历年真题汇总
- SSM3J02T-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- SSM3J02F-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 利用LFM矩阵分解进行协同过滤推荐+源代码+文档说明
- socket资源程序:本程序包含socket聊天程序,tcp协议实现
- Anaconda安装、运行方法及简单案例运行介绍.zip
- 项目以推荐系统领域知名的经过修改过的中文亚马逊电商数据集作为依托,以电商网站真实业务数据架构为基础,构建了这套一体化电商推荐系统
- SSM3J01T-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- SSM2318GEN-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- K8S网络通讯calico 3.19.4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0