diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
commit | f8965467f366fd18f01feafb5db10512d7b4422c (patch) | |
tree | 3706a9cd779859271ca61b85c63a1bc3f82d626e /include/net/caif/cfctrl.h | |
parent | a26272e5200765691e67d6780e52b32498fdb659 (diff) | |
parent | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
qlcnic: adding co maintainer
ixgbe: add support for active DA cables
ixgbe: dcb, do not tag tc_prio_control frames
ixgbe: fix ixgbe_tx_is_paused logic
ixgbe: always enable vlan strip/insert when DCB is enabled
ixgbe: remove some redundant code in setting FCoE FIP filter
ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
ixgbe: fix header len when unsplit packet overflows to data buffer
ipv6: Never schedule DAD timer on dead address
ipv6: Use POSTDAD state
ipv6: Use state_lock to protect ifa state
ipv6: Replace inet6_ifaddr->dead with state
cxgb4: notify upper drivers if the device is already up when they load
cxgb4: keep interrupts available when the ports are brought down
cxgb4: fix initial addition of MAC address
cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
cnic: Convert cnic_local_flags to atomic ops.
can: Fix SJA1000 command register writes on SMP systems
bridge: fix build for CONFIG_SYSFS disabled
ARCNET: Limit com20020 PCI ID matches for SOHARD cards
...
Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).
Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'include/net/caif/cfctrl.h')
-rw-r--r-- | include/net/caif/cfctrl.h | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h new file mode 100644 index 000000000000..997603f2bf4c --- /dev/null +++ b/include/net/caif/cfctrl.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson AB 2010 | ||
3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef CFCTRL_H_ | ||
8 | #define CFCTRL_H_ | ||
9 | #include <net/caif/caif_layer.h> | ||
10 | #include <net/caif/cfsrvl.h> | ||
11 | |||
12 | /* CAIF Control packet commands */ | ||
13 | enum cfctrl_cmd { | ||
14 | CFCTRL_CMD_LINK_SETUP = 0, | ||
15 | CFCTRL_CMD_LINK_DESTROY = 1, | ||
16 | CFCTRL_CMD_LINK_ERR = 2, | ||
17 | CFCTRL_CMD_ENUM = 3, | ||
18 | CFCTRL_CMD_SLEEP = 4, | ||
19 | CFCTRL_CMD_WAKE = 5, | ||
20 | CFCTRL_CMD_LINK_RECONF = 6, | ||
21 | CFCTRL_CMD_START_REASON = 7, | ||
22 | CFCTRL_CMD_RADIO_SET = 8, | ||
23 | CFCTRL_CMD_MODEM_SET = 9, | ||
24 | CFCTRL_CMD_MASK = 0xf | ||
25 | }; | ||
26 | |||
27 | /* Channel types */ | ||
28 | enum cfctrl_srv { | ||
29 | CFCTRL_SRV_DECM = 0, | ||
30 | CFCTRL_SRV_VEI = 1, | ||
31 | CFCTRL_SRV_VIDEO = 2, | ||
32 | CFCTRL_SRV_DBG = 3, | ||
33 | CFCTRL_SRV_DATAGRAM = 4, | ||
34 | CFCTRL_SRV_RFM = 5, | ||
35 | CFCTRL_SRV_UTIL = 6, | ||
36 | CFCTRL_SRV_MASK = 0xf | ||
37 | }; | ||
38 | |||
39 | #define CFCTRL_RSP_BIT 0x20 | ||
40 | #define CFCTRL_ERR_BIT 0x10 | ||
41 | |||
42 | struct cfctrl_rsp { | ||
43 | void (*linksetup_rsp)(struct cflayer *layer, u8 linkid, | ||
44 | enum cfctrl_srv serv, u8 phyid, | ||
45 | struct cflayer *adapt_layer); | ||
46 | void (*linkdestroy_rsp)(struct cflayer *layer, u8 linkid); | ||
47 | void (*linkerror_ind)(void); | ||
48 | void (*enum_rsp)(void); | ||
49 | void (*sleep_rsp)(void); | ||
50 | void (*wake_rsp)(void); | ||
51 | void (*restart_rsp)(void); | ||
52 | void (*radioset_rsp)(void); | ||
53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, | ||
54 | struct cflayer *client_layer);; | ||
55 | }; | ||
56 | |||
57 | /* Link Setup Parameters for CAIF-Links. */ | ||
58 | struct cfctrl_link_param { | ||
59 | enum cfctrl_srv linktype;/* (T3,T0) Type of Channel */ | ||
60 | u8 priority; /* (P4,P0) Priority of the channel */ | ||
61 | u8 phyid; /* (U2-U0) Physical interface to connect */ | ||
62 | u8 endpoint; /* (E1,E0) Endpoint for data channels */ | ||
63 | u8 chtype; /* (H1,H0) Channel-Type, applies to | ||
64 | * VEI, DEBUG */ | ||
65 | union { | ||
66 | struct { | ||
67 | u8 connid; /* (D7,D0) Video LinkId */ | ||
68 | } video; | ||
69 | |||
70 | struct { | ||
71 | u32 connid; /* (N31,Ngit0) Connection ID used | ||
72 | * for Datagram */ | ||
73 | } datagram; | ||
74 | |||
75 | struct { | ||
76 | u32 connid; /* Connection ID used for RFM */ | ||
77 | char volume[20]; /* Volume to mount for RFM */ | ||
78 | } rfm; /* Configuration for RFM */ | ||
79 | |||
80 | struct { | ||
81 | u16 fifosize_kb; /* Psock FIFO size in KB */ | ||
82 | u16 fifosize_bufs; /* Psock # signal buffers */ | ||
83 | char name[16]; /* Name of the PSOCK service */ | ||
84 | u8 params[255]; /* Link setup Parameters> */ | ||
85 | u16 paramlen; /* Length of Link Setup | ||
86 | * Parameters */ | ||
87 | } utility; /* Configuration for Utility Links (Psock) */ | ||
88 | } u; | ||
89 | }; | ||
90 | |||
91 | /* This structure is used internally in CFCTRL */ | ||
92 | struct cfctrl_request_info { | ||
93 | int sequence_no; | ||
94 | enum cfctrl_cmd cmd; | ||
95 | u8 channel_id; | ||
96 | struct cfctrl_link_param param; | ||
97 | struct cfctrl_request_info *next; | ||
98 | struct cflayer *client_layer; | ||
99 | }; | ||
100 | |||
101 | struct cfctrl { | ||
102 | struct cfsrvl serv; | ||
103 | struct cfctrl_rsp res; | ||
104 | atomic_t req_seq_no; | ||
105 | atomic_t rsp_seq_no; | ||
106 | struct cfctrl_request_info *first_req; | ||
107 | /* Protects from simultaneous access to first_req list */ | ||
108 | spinlock_t info_list_lock; | ||
109 | #ifndef CAIF_NO_LOOP | ||
110 | u8 loop_linkid; | ||
111 | int loop_linkused[256]; | ||
112 | /* Protects simultaneous access to loop_linkid and loop_linkused */ | ||
113 | spinlock_t loop_linkid_lock; | ||
114 | #endif | ||
115 | |||
116 | }; | ||
117 | |||
118 | void cfctrl_enum_req(struct cflayer *cfctrl, u8 physlinkid); | ||
119 | int cfctrl_linkup_request(struct cflayer *cfctrl, | ||
120 | struct cfctrl_link_param *param, | ||
121 | struct cflayer *user_layer); | ||
122 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, | ||
123 | struct cflayer *client); | ||
124 | void cfctrl_sleep_req(struct cflayer *cfctrl); | ||
125 | void cfctrl_wake_req(struct cflayer *cfctrl); | ||
126 | void cfctrl_getstartreason_req(struct cflayer *cfctrl); | ||
127 | struct cflayer *cfctrl_create(void); | ||
128 | void cfctrl_set_dnlayer(struct cflayer *this, struct cflayer *dn); | ||
129 | void cfctrl_set_uplayer(struct cflayer *this, struct cflayer *up); | ||
130 | struct cfctrl_rsp *cfctrl_get_respfuncs(struct cflayer *layer); | ||
131 | bool cfctrl_req_eq(struct cfctrl_request_info *r1, | ||
132 | struct cfctrl_request_info *r2); | ||
133 | void cfctrl_insert_req(struct cfctrl *ctrl, | ||
134 | struct cfctrl_request_info *req); | ||
135 | struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, | ||
136 | struct cfctrl_request_info *req); | ||
137 | void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer); | ||
138 | |||
139 | #endif /* CFCTRL_H_ */ | ||