Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
294da3a
Documentation
arch
block
crypto
drivers
accessibility
acpi
amba
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma
edac
eisa
extcon
firewire
firmware
fmc
gpio
gpu
hid
hsi
hv
hwmon
hwspinlock
i2c
ide
idle
iio
infiniband
input
iommu
ipack
irqchip
isdn
leds
lguest
macintosh
mailbox
md
media
memory
memstick
message
mfd
misc
mmc
mtd
net
appletalk
arcnet
bonding
caif
can
cris
dsa
ethernet
fddi
hamradio
hippi
hyperv
ieee802154
irda
Kconfig
Makefile
act200l-sir.c
actisys-sir.c
ali-ircc.c
ali-ircc.h
au1k_ir.c
bfin_sir.c
bfin_sir.h
donauboe.c
donauboe.h
ep7211-sir.c
esi-sir.c
girbil-sir.c
irda-usb.c
irda-usb.h
irtty-sir.c
irtty-sir.h
kingsun-sir.c
ks959-sir.c
ksdazzle-sir.c
litelink-sir.c
ma600-sir.c
mcp2120-sir.c
mcs7780.c
mcs7780.h
nsc-ircc.c
nsc-ircc.h
old_belkin-sir.c
pxaficp_ir.c
sa1100_ir.c
sh_irda.c
sh_sir.c
sir-dev.h
sir_dev.c
sir_dongle.c
smsc-ircc2.c
smsc-ircc2.h
smsc-sio.h
stir4200.c
tekram-sir.c
toim3232-sir.c
via-ircc.c
via-ircc.h
vlsi_ir.c
vlsi_ir.h
w83977af.h
w83977af_ir.c
w83977af_ir.h
phy
plip
ppp
slip
team
usb
vmxnet3
wan
wimax
wireless
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
ifb.c
loopback.c
macvlan.c
macvtap.c
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c
veth.c
virtio_net.c
vxlan.c
xen-netfront.c
nfc
ntb
nubus
of
oprofile
parisc
parport
pci
pcmcia
pinctrl
platform
pnp
power
pps
ps3
ptp
pwm
rapidio
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
sn
spi
ssb
staging
target
tc
thermal
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
drivers
/
net
/
irda
/
sir-dev.h
Blame
Blame
Latest commit
History
History
191 lines (132 loc) · 4.69 KB
Breadcrumbs
linux
/
drivers
/
net
/
irda
/
sir-dev.h
Top
File metadata and controls
Code
Blame
191 lines (132 loc) · 4.69 KB
Raw
/********************************************************************* * * sir.h: include file for irda-sir device abstraction layer * * Copyright (c) 2002 Martin Diehl * * 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. * ********************************************************************/ #ifndef IRDA_SIR_H #define IRDA_SIR_H #include <linux/netdevice.h> #include <linux/workqueue.h> #include <net/irda/irda.h> #include <net/irda/irda_device.h> // iobuff_t struct sir_fsm { struct semaphore sem; struct delayed_work work; unsigned state, substate; int param; int result; }; #define SIRDEV_STATE_WAIT_TX_COMPLETE 0x0100 /* substates for wait_tx_complete */ #define SIRDEV_STATE_WAIT_XMIT 0x0101 #define SIRDEV_STATE_WAIT_UNTIL_SENT 0x0102 #define SIRDEV_STATE_TX_DONE 0x0103 #define SIRDEV_STATE_DONGLE_OPEN 0x0300 /* 0x0301-0x03ff reserved for individual dongle substates */ #define SIRDEV_STATE_DONGLE_CLOSE 0x0400 /* 0x0401-0x04ff reserved for individual dongle substates */ #define SIRDEV_STATE_SET_DTR_RTS 0x0500 #define SIRDEV_STATE_SET_SPEED 0x0700 #define SIRDEV_STATE_DONGLE_CHECK 0x0800 #define SIRDEV_STATE_DONGLE_RESET 0x0900 /* 0x0901-0x09ff reserved for individual dongle substates */ #define SIRDEV_STATE_DONGLE_SPEED 0x0a00 /* 0x0a01-0x0aff reserved for individual dongle substates */ #define SIRDEV_STATE_PORT_SPEED 0x0b00 #define SIRDEV_STATE_DONE 0x0c00 #define SIRDEV_STATE_ERROR 0x0d00 #define SIRDEV_STATE_COMPLETE 0x0e00 #define SIRDEV_STATE_DEAD 0xffff struct sir_dev; struct dongle_driver { struct module *owner; const char *driver_name; IRDA_DONGLE type; int (*open)(struct sir_dev *dev); int (*close)(struct sir_dev *dev); int (*reset)(struct sir_dev *dev); int (*set_speed)(struct sir_dev *dev, unsigned speed); struct list_head dongle_list; }; struct sir_driver { struct module *owner; const char *driver_name; int qos_mtt_bits; int (*chars_in_buffer)(struct sir_dev *dev); void (*wait_until_sent)(struct sir_dev *dev); int (*set_speed)(struct sir_dev *dev, unsigned speed); int (*set_dtr_rts)(struct sir_dev *dev, int dtr, int rts); int (*do_write)(struct sir_dev *dev, const unsigned char *ptr, size_t len); int (*start_dev)(struct sir_dev *dev); int (*stop_dev)(struct sir_dev *dev); }; /* exported */ int irda_register_dongle(struct dongle_driver *new); int irda_unregister_dongle(struct dongle_driver *drv); struct sir_dev *sirdev_get_instance(const struct sir_driver *drv, const char *name); int sirdev_put_instance(struct sir_dev *self); int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type); void sirdev_write_complete(struct sir_dev *dev); int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count); /* low level helpers for SIR device/dongle setup */ int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len); int sirdev_raw_read(struct sir_dev *dev, char *buf, int len); int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts); /* not exported */ int sirdev_get_dongle(struct sir_dev *self, IRDA_DONGLE type); int sirdev_put_dongle(struct sir_dev *self); void sirdev_enable_rx(struct sir_dev *dev); int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param); /* inline helpers */ static inline int sirdev_schedule_speed(struct sir_dev *dev, unsigned speed) { return sirdev_schedule_request(dev, SIRDEV_STATE_SET_SPEED, speed); } static inline int sirdev_schedule_dongle_open(struct sir_dev *dev, int dongle_id) { return sirdev_schedule_request(dev, SIRDEV_STATE_DONGLE_OPEN, dongle_id); } static inline int sirdev_schedule_dongle_close(struct sir_dev *dev) { return sirdev_schedule_request(dev, SIRDEV_STATE_DONGLE_CLOSE, 0); } static inline int sirdev_schedule_dtr_rts(struct sir_dev *dev, int dtr, int rts) { int dtrrts; dtrrts = ((dtr) ? 0x02 : 0x00) | ((rts) ? 0x01 : 0x00); return sirdev_schedule_request(dev, SIRDEV_STATE_SET_DTR_RTS, dtrrts); } #if 0 static inline int sirdev_schedule_mode(struct sir_dev *dev, int mode) { return sirdev_schedule_request(dev, SIRDEV_STATE_SET_MODE, mode); } #endif struct sir_dev { struct net_device *netdev; struct irlap_cb *irlap; struct qos_info qos; char hwname[32]; struct sir_fsm fsm; atomic_t enable_rx; int raw_tx; spinlock_t tx_lock; u32 new_speed; u32 flags; unsigned speed; iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ struct sk_buff *tx_skb; const struct dongle_driver * dongle_drv; const struct sir_driver * drv; void *priv; }; #endif /* IRDA_SIR_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
You can’t perform that action at this time.