aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/capi.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-19 22:52:38 -0500
committerJoe Perches <joe@perches.com>2012-02-21 12:04:01 -0500
commit475be4d85a274d0961593db41cf85689db1d583c (patch)
treeb2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/gigaset/capi.c
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style. Update the coding style used on a per-line basis so that git diff -w shows only elided blank lines at EOF. Done with emacs and some scripts and some typing. Built x86 allyesconfig. No detected change in objdump -d or size. Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/gigaset/capi.c')
-rw-r--r--drivers/isdn/gigaset/capi.c228
1 files changed, 114 insertions, 114 deletions
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
index 6d5ceeece9f2..343b5c80cb7b 100644
--- a/drivers/isdn/gigaset/capi.c
+++ b/drivers/isdn/gigaset/capi.c
@@ -26,17 +26,17 @@
26#define CapiFacilitySpecificFunctionNotSupported 0x3011 26#define CapiFacilitySpecificFunctionNotSupported 0x3011
27 27
28/* missing from capicmd.h */ 28/* missing from capicmd.h */
29#define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN+4+2+8*1) 29#define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 8 * 1)
30#define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+3*1) 30#define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 3 * 1)
31#define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+1) 31#define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
32#define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+1) 32#define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
33#define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN+4+4+2+2+2+8) 33#define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN + 4 + 4 + 2 + 2 + 2 + 8)
34#define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN+4+2+2) 34#define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN + 4 + 2 + 2)
35#define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN+4+2) 35#define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN + 4 + 2)
36#define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+2+1) 36#define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 1)
37#define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN+4+2+2+1) 37#define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 2 + 1)
38/* most _CONF messages contain only Controller/PLCI/NCCI and Info parameters */ 38/* most _CONF messages contain only Controller/PLCI/NCCI and Info parameters */
39#define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN+4+2) 39#define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN + 4 + 2)
40 40
41#define CAPI_FACILITY_HANDSET 0x0000 41#define CAPI_FACILITY_HANDSET 0x0000
42#define CAPI_FACILITY_DTMF 0x0001 42#define CAPI_FACILITY_DTMF 0x0001
@@ -97,10 +97,10 @@ struct gigaset_capi_ctr {
97 /* two _cmsg structures possibly used concurrently: */ 97 /* two _cmsg structures possibly used concurrently: */
98 _cmsg hcmsg; /* for message composition triggered from hardware */ 98 _cmsg hcmsg; /* for message composition triggered from hardware */
99 _cmsg acmsg; /* for dissection of messages sent from application */ 99 _cmsg acmsg; /* for dissection of messages sent from application */
100 u8 bc_buf[MAX_BC_OCTETS+1]; 100 u8 bc_buf[MAX_BC_OCTETS + 1];
101 u8 hlc_buf[MAX_HLC_OCTETS+1]; 101 u8 hlc_buf[MAX_HLC_OCTETS + 1];
102 u8 cgpty_buf[MAX_NUMBER_DIGITS+3]; 102 u8 cgpty_buf[MAX_NUMBER_DIGITS + 3];
103 u8 cdpty_buf[MAX_NUMBER_DIGITS+2]; 103 u8 cdpty_buf[MAX_NUMBER_DIGITS + 2];
104}; 104};
105 105
106/* CIP Value table (from CAPI 2.0 standard, ch. 6.1) */ 106/* CIP Value table (from CAPI 2.0 standard, ch. 6.1) */
@@ -109,50 +109,50 @@ static struct {
109 u8 *hlc; 109 u8 *hlc;
110} cip2bchlc[] = { 110} cip2bchlc[] = {
111 [1] = { "8090A3", NULL }, 111 [1] = { "8090A3", NULL },
112 /* Speech (A-law) */ 112 /* Speech (A-law) */
113 [2] = { "8890", NULL }, 113 [2] = { "8890", NULL },
114 /* Unrestricted digital information */ 114 /* Unrestricted digital information */
115 [3] = { "8990", NULL }, 115 [3] = { "8990", NULL },
116 /* Restricted digital information */ 116 /* Restricted digital information */
117 [4] = { "9090A3", NULL }, 117 [4] = { "9090A3", NULL },
118 /* 3,1 kHz audio (A-law) */ 118 /* 3,1 kHz audio (A-law) */
119 [5] = { "9190", NULL }, 119 [5] = { "9190", NULL },
120 /* 7 kHz audio */ 120 /* 7 kHz audio */
121 [6] = { "9890", NULL }, 121 [6] = { "9890", NULL },
122 /* Video */ 122 /* Video */
123 [7] = { "88C0C6E6", NULL }, 123 [7] = { "88C0C6E6", NULL },
124 /* Packet mode */ 124 /* Packet mode */
125 [8] = { "8890218F", NULL }, 125 [8] = { "8890218F", NULL },
126 /* 56 kbit/s rate adaptation */ 126 /* 56 kbit/s rate adaptation */
127 [9] = { "9190A5", NULL }, 127 [9] = { "9190A5", NULL },
128 /* Unrestricted digital information with tones/announcements */ 128 /* Unrestricted digital information with tones/announcements */
129 [16] = { "8090A3", "9181" }, 129 [16] = { "8090A3", "9181" },
130 /* Telephony */ 130 /* Telephony */
131 [17] = { "9090A3", "9184" }, 131 [17] = { "9090A3", "9184" },
132 /* Group 2/3 facsimile */ 132 /* Group 2/3 facsimile */
133 [18] = { "8890", "91A1" }, 133 [18] = { "8890", "91A1" },
134 /* Group 4 facsimile Class 1 */ 134 /* Group 4 facsimile Class 1 */
135 [19] = { "8890", "91A4" }, 135 [19] = { "8890", "91A4" },
136 /* Teletex service basic and mixed mode 136 /* Teletex service basic and mixed mode
137 and Group 4 facsimile service Classes II and III */ 137 and Group 4 facsimile service Classes II and III */
138 [20] = { "8890", "91A8" }, 138 [20] = { "8890", "91A8" },
139 /* Teletex service basic and processable mode */ 139 /* Teletex service basic and processable mode */
140 [21] = { "8890", "91B1" }, 140 [21] = { "8890", "91B1" },
141 /* Teletex service basic mode */ 141 /* Teletex service basic mode */
142 [22] = { "8890", "91B2" }, 142 [22] = { "8890", "91B2" },
143 /* International interworking for Videotex */ 143 /* International interworking for Videotex */
144 [23] = { "8890", "91B5" }, 144 [23] = { "8890", "91B5" },
145 /* Telex */ 145 /* Telex */
146 [24] = { "8890", "91B8" }, 146 [24] = { "8890", "91B8" },
147 /* Message Handling Systems in accordance with X.400 */ 147 /* Message Handling Systems in accordance with X.400 */
148 [25] = { "8890", "91C1" }, 148 [25] = { "8890", "91C1" },
149 /* OSI application in accordance with X.200 */ 149 /* OSI application in accordance with X.200 */
150 [26] = { "9190A5", "9181" }, 150 [26] = { "9190A5", "9181" },
151 /* 7 kHz telephony */ 151 /* 7 kHz telephony */
152 [27] = { "9190A5", "916001" }, 152 [27] = { "9190A5", "916001" },
153 /* Video telephony, first connection */ 153 /* Video telephony, first connection */
154 [28] = { "8890", "916002" }, 154 [28] = { "8890", "916002" },
155 /* Video telephony, second connection */ 155 /* Video telephony, second connection */
156}; 156};
157 157
158/* 158/*
@@ -164,7 +164,7 @@ static struct {
164 * emit unsupported parameter warning 164 * emit unsupported parameter warning
165 */ 165 */
166static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param, 166static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
167 char *msgname, char *paramname) 167 char *msgname, char *paramname)
168{ 168{
169 if (param && *param) 169 if (param && *param)
170 dev_warn(cs->dev, "%s: ignoring unsupported parameter: %s\n", 170 dev_warn(cs->dev, "%s: ignoring unsupported parameter: %s\n",
@@ -259,15 +259,15 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
259 CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l, 259 CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l,
260 CAPIMSG_CONTROL(data)); 260 CAPIMSG_CONTROL(data));
261 l -= 12; 261 l -= 12;
262 dbgline = kmalloc(3*l, GFP_ATOMIC); 262 dbgline = kmalloc(3 * l, GFP_ATOMIC);
263 if (!dbgline) 263 if (!dbgline)
264 return; 264 return;
265 for (i = 0; i < l; i++) { 265 for (i = 0; i < l; i++) {
266 dbgline[3*i] = hex_asc_hi(data[12+i]); 266 dbgline[3 * i] = hex_asc_hi(data[12 + i]);
267 dbgline[3*i+1] = hex_asc_lo(data[12+i]); 267 dbgline[3 * i + 1] = hex_asc_lo(data[12 + i]);
268 dbgline[3*i+2] = ' '; 268 dbgline[3 * i + 2] = ' ';
269 } 269 }
270 dbgline[3*l-1] = '\0'; 270 dbgline[3 * l - 1] = '\0';
271 gig_dbg(level, " %s", dbgline); 271 gig_dbg(level, " %s", dbgline);
272 kfree(dbgline); 272 kfree(dbgline);
273 if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 && 273 if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 &&
@@ -279,16 +279,16 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
279 return; 279 return;
280 if (l > 64) 280 if (l > 64)
281 l = 64; /* arbitrary limit */ 281 l = 64; /* arbitrary limit */
282 dbgline = kmalloc(3*l, GFP_ATOMIC); 282 dbgline = kmalloc(3 * l, GFP_ATOMIC);
283 if (!dbgline) 283 if (!dbgline)
284 return; 284 return;
285 data += CAPIMSG_LEN(data); 285 data += CAPIMSG_LEN(data);
286 for (i = 0; i < l; i++) { 286 for (i = 0; i < l; i++) {
287 dbgline[3*i] = hex_asc_hi(data[i]); 287 dbgline[3 * i] = hex_asc_hi(data[i]);
288 dbgline[3*i+1] = hex_asc_lo(data[i]); 288 dbgline[3 * i + 1] = hex_asc_lo(data[i]);
289 dbgline[3*i+2] = ' '; 289 dbgline[3 * i + 2] = ' ';
290 } 290 }
291 dbgline[3*l-1] = '\0'; 291 dbgline[3 * l - 1] = '\0';
292 gig_dbg(level, " %s", dbgline); 292 gig_dbg(level, " %s", dbgline);
293 kfree(dbgline); 293 kfree(dbgline);
294 } 294 }
@@ -301,7 +301,7 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
301 301
302static const char *format_ie(const char *ie) 302static const char *format_ie(const char *ie)
303{ 303{
304 static char result[3*MAX_FMT_IE_LEN]; 304 static char result[3 * MAX_FMT_IE_LEN];
305 int len, count; 305 int len, count;
306 char *pout = result; 306 char *pout = result;
307 307
@@ -310,7 +310,7 @@ static const char *format_ie(const char *ie)
310 310
311 count = len = ie[0]; 311 count = len = ie[0];
312 if (count > MAX_FMT_IE_LEN) 312 if (count > MAX_FMT_IE_LEN)
313 count = MAX_FMT_IE_LEN-1; 313 count = MAX_FMT_IE_LEN - 1;
314 while (count--) { 314 while (count--) {
315 *pout++ = hex_asc_hi(*++ie); 315 *pout++ = hex_asc_hi(*++ie);
316 *pout++ = hex_asc_lo(*ie); 316 *pout++ = hex_asc_lo(*ie);
@@ -403,8 +403,8 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
403 send_data_b3_conf(cs, &iif->ctr, ap->id, CAPIMSG_MSGID(req), 403 send_data_b3_conf(cs, &iif->ctr, ap->id, CAPIMSG_MSGID(req),
404 bcs->channel + 1, CAPIMSG_HANDLE_REQ(req), 404 bcs->channel + 1, CAPIMSG_HANDLE_REQ(req),
405 (flags & ~CAPI_FLAGS_DELIVERY_CONFIRMATION) ? 405 (flags & ~CAPI_FLAGS_DELIVERY_CONFIRMATION) ?
406 CapiFlagsNotSupportedByProtocol : 406 CapiFlagsNotSupportedByProtocol :
407 CAPI_NOERROR); 407 CAPI_NOERROR);
408} 408}
409EXPORT_SYMBOL_GPL(gigaset_skb_sent); 409EXPORT_SYMBOL_GPL(gigaset_skb_sent);
410 410
@@ -589,7 +589,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
589 } 589 }
590 iif->cdpty_buf[0] = i + 1; 590 iif->cdpty_buf[0] = i + 1;
591 iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */ 591 iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */
592 memcpy(iif->cdpty_buf+2, at_state->str_var[STR_ZCPN], i); 592 memcpy(iif->cdpty_buf + 2, at_state->str_var[STR_ZCPN], i);
593 iif->hcmsg.CalledPartyNumber = iif->cdpty_buf; 593 iif->hcmsg.CalledPartyNumber = iif->cdpty_buf;
594 msgsize += iif->hcmsg.CalledPartyNumber[0]; 594 msgsize += iif->hcmsg.CalledPartyNumber[0];
595 } 595 }
@@ -605,7 +605,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
605 iif->cgpty_buf[0] = i + 2; 605 iif->cgpty_buf[0] = i + 2;
606 iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */ 606 iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */
607 iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */ 607 iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */
608 memcpy(iif->cgpty_buf+3, at_state->str_var[STR_NMBR], i); 608 memcpy(iif->cgpty_buf + 3, at_state->str_var[STR_NMBR], i);
609 iif->hcmsg.CallingPartyNumber = iif->cgpty_buf; 609 iif->hcmsg.CallingPartyNumber = iif->cgpty_buf;
610 msgsize += iif->hcmsg.CallingPartyNumber[0]; 610 msgsize += iif->hcmsg.CallingPartyNumber[0];
611 } 611 }
@@ -977,7 +977,7 @@ void gigaset_isdn_stop(struct cardstate *cs)
977 * register CAPI application 977 * register CAPI application
978 */ 978 */
979static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl, 979static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl,
980 capi_register_params *rp) 980 capi_register_params *rp)
981{ 981{
982 struct gigaset_capi_ctr *iif 982 struct gigaset_capi_ctr *iif
983 = container_of(ctr, struct gigaset_capi_ctr, ctr); 983 = container_of(ctr, struct gigaset_capi_ctr, ctr);
@@ -1181,21 +1181,21 @@ static void do_facility_req(struct gigaset_capi_ctr *iif,
1181 } 1181 }
1182 if (CAPIMSG_U32(pparam, 4) != 0) { 1182 if (CAPIMSG_U32(pparam, 4) != 0) {
1183 dev_notice(cs->dev, 1183 dev_notice(cs->dev,
1184 "%s: unsupported supplementary service notification mask 0x%x\n", 1184 "%s: unsupported supplementary service notification mask 0x%x\n",
1185 "FACILITY_REQ", CAPIMSG_U32(pparam, 4)); 1185 "FACILITY_REQ", CAPIMSG_U32(pparam, 4));
1186 info = CapiFacilitySpecificFunctionNotSupported; 1186 info = CapiFacilitySpecificFunctionNotSupported;
1187 confparam[3] = 2; /* length */ 1187 confparam[3] = 2; /* length */
1188 capimsg_setu16(confparam, 4, 1188 capimsg_setu16(confparam, 4,
1189 CapiSupplementaryServiceNotSupported); 1189 CapiSupplementaryServiceNotSupported);
1190 } 1190 }
1191 info = CapiSuccess; 1191 info = CapiSuccess;
1192 confparam[3] = 2; /* length */ 1192 confparam[3] = 2; /* length */
1193 capimsg_setu16(confparam, 4, CapiSuccess); 1193 capimsg_setu16(confparam, 4, CapiSuccess);
1194 break; 1194 break;
1195 /* ToDo: add supported services */ 1195 /* ToDo: add supported services */
1196 default: 1196 default:
1197 dev_notice(cs->dev, 1197 dev_notice(cs->dev,
1198 "%s: unsupported supplementary service function 0x%04x\n", 1198 "%s: unsupported supplementary service function 0x%04x\n",
1199 "FACILITY_REQ", function); 1199 "FACILITY_REQ", function);
1200 info = CapiFacilitySpecificFunctionNotSupported; 1200 info = CapiFacilitySpecificFunctionNotSupported;
1201 /* Supplementary Service specific parameter */ 1201 /* Supplementary Service specific parameter */
@@ -1318,7 +1318,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1318 cmsg->adr.adrPLCI |= (bcs->channel + 1) << 8; 1318 cmsg->adr.adrPLCI |= (bcs->channel + 1) << 8;
1319 1319
1320 /* build command table */ 1320 /* build command table */
1321 commands = kzalloc(AT_NUM*(sizeof *commands), GFP_KERNEL); 1321 commands = kzalloc(AT_NUM * (sizeof *commands), GFP_KERNEL);
1322 if (!commands) 1322 if (!commands)
1323 goto oom; 1323 goto oom;
1324 1324
@@ -1353,10 +1353,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1353 commands[AT_TYPE] = kstrdup(s, GFP_KERNEL); 1353 commands[AT_TYPE] = kstrdup(s, GFP_KERNEL);
1354 if (!commands[AT_TYPE]) 1354 if (!commands[AT_TYPE])
1355 goto oom; 1355 goto oom;
1356 commands[AT_DIAL] = kmalloc(l+3, GFP_KERNEL); 1356 commands[AT_DIAL] = kmalloc(l + 3, GFP_KERNEL);
1357 if (!commands[AT_DIAL]) 1357 if (!commands[AT_DIAL])
1358 goto oom; 1358 goto oom;
1359 snprintf(commands[AT_DIAL], l+3, "D%.*s\r", l, pp); 1359 snprintf(commands[AT_DIAL], l + 3, "D%.*s\r", l, pp);
1360 1360
1361 /* encode parameter: Calling party number */ 1361 /* encode parameter: Calling party number */
1362 pp = cmsg->CallingPartyNumber; 1362 pp = cmsg->CallingPartyNumber;
@@ -1406,10 +1406,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1406 1406
1407 if (l) { 1407 if (l) {
1408 /* number */ 1408 /* number */
1409 commands[AT_MSN] = kmalloc(l+8, GFP_KERNEL); 1409 commands[AT_MSN] = kmalloc(l + 8, GFP_KERNEL);
1410 if (!commands[AT_MSN]) 1410 if (!commands[AT_MSN])
1411 goto oom; 1411 goto oom;
1412 snprintf(commands[AT_MSN], l+8, "^SMSN=%*s\r", l, pp); 1412 snprintf(commands[AT_MSN], l + 8, "^SMSN=%*s\r", l, pp);
1413 } 1413 }
1414 } 1414 }
1415 1415
@@ -1430,13 +1430,13 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1430 1430
1431 /* determine lengths */ 1431 /* determine lengths */
1432 if (cmsg->BC && cmsg->BC[0]) /* BC specified explicitly */ 1432 if (cmsg->BC && cmsg->BC[0]) /* BC specified explicitly */
1433 lbc = 2*cmsg->BC[0]; 1433 lbc = 2 * cmsg->BC[0];
1434 else if (cip2bchlc[cmsg->CIPValue].bc) /* BC derived from CIP */ 1434 else if (cip2bchlc[cmsg->CIPValue].bc) /* BC derived from CIP */
1435 lbc = strlen(cip2bchlc[cmsg->CIPValue].bc); 1435 lbc = strlen(cip2bchlc[cmsg->CIPValue].bc);
1436 else /* no BC */ 1436 else /* no BC */
1437 lbc = 0; 1437 lbc = 0;
1438 if (cmsg->HLC && cmsg->HLC[0]) /* HLC specified explicitly */ 1438 if (cmsg->HLC && cmsg->HLC[0]) /* HLC specified explicitly */
1439 lhlc = 2*cmsg->HLC[0]; 1439 lhlc = 2 * cmsg->HLC[0];
1440 else if (cip2bchlc[cmsg->CIPValue].hlc) /* HLC derived from CIP */ 1440 else if (cip2bchlc[cmsg->CIPValue].hlc) /* HLC derived from CIP */
1441 lhlc = strlen(cip2bchlc[cmsg->CIPValue].hlc); 1441 lhlc = strlen(cip2bchlc[cmsg->CIPValue].hlc);
1442 else /* no HLC */ 1442 else /* no HLC */
@@ -1481,7 +1481,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1481 if (cmsg->BProtocol == CAPI_DEFAULT) { 1481 if (cmsg->BProtocol == CAPI_DEFAULT) {
1482 bcs->proto2 = L2_HDLC; 1482 bcs->proto2 = L2_HDLC;
1483 dev_warn(cs->dev, 1483 dev_warn(cs->dev,
1484 "B2 Protocol X.75 SLP unsupported, using Transparent\n"); 1484 "B2 Protocol X.75 SLP unsupported, using Transparent\n");
1485 } else { 1485 } else {
1486 switch (cmsg->B1protocol) { 1486 switch (cmsg->B1protocol) {
1487 case 0: 1487 case 0:
@@ -1492,24 +1492,24 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1492 break; 1492 break;
1493 default: 1493 default:
1494 dev_warn(cs->dev, 1494 dev_warn(cs->dev,
1495 "B1 Protocol %u unsupported, using Transparent\n", 1495 "B1 Protocol %u unsupported, using Transparent\n",
1496 cmsg->B1protocol); 1496 cmsg->B1protocol);
1497 bcs->proto2 = L2_VOICE; 1497 bcs->proto2 = L2_VOICE;
1498 } 1498 }
1499 if (cmsg->B2protocol != 1) 1499 if (cmsg->B2protocol != 1)
1500 dev_warn(cs->dev, 1500 dev_warn(cs->dev,
1501 "B2 Protocol %u unsupported, using Transparent\n", 1501 "B2 Protocol %u unsupported, using Transparent\n",
1502 cmsg->B2protocol); 1502 cmsg->B2protocol);
1503 if (cmsg->B3protocol != 0) 1503 if (cmsg->B3protocol != 0)
1504 dev_warn(cs->dev, 1504 dev_warn(cs->dev,
1505 "B3 Protocol %u unsupported, using Transparent\n", 1505 "B3 Protocol %u unsupported, using Transparent\n",
1506 cmsg->B3protocol); 1506 cmsg->B3protocol);
1507 ignore_cstruct_param(cs, cmsg->B1configuration, 1507 ignore_cstruct_param(cs, cmsg->B1configuration,
1508 "CONNECT_REQ", "B1 Configuration"); 1508 "CONNECT_REQ", "B1 Configuration");
1509 ignore_cstruct_param(cs, cmsg->B2configuration, 1509 ignore_cstruct_param(cs, cmsg->B2configuration,
1510 "CONNECT_REQ", "B2 Configuration"); 1510 "CONNECT_REQ", "B2 Configuration");
1511 ignore_cstruct_param(cs, cmsg->B3configuration, 1511 ignore_cstruct_param(cs, cmsg->B3configuration,
1512 "CONNECT_REQ", "B3 Configuration"); 1512 "CONNECT_REQ", "B3 Configuration");
1513 } 1513 }
1514 commands[AT_PROTO] = kmalloc(9, GFP_KERNEL); 1514 commands[AT_PROTO] = kmalloc(9, GFP_KERNEL);
1515 if (!commands[AT_PROTO]) 1515 if (!commands[AT_PROTO])
@@ -1518,20 +1518,20 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
1518 1518
1519 /* ToDo: check/encode remaining parameters */ 1519 /* ToDo: check/encode remaining parameters */
1520 ignore_cstruct_param(cs, cmsg->CalledPartySubaddress, 1520 ignore_cstruct_param(cs, cmsg->CalledPartySubaddress,
1521 "CONNECT_REQ", "Called pty subaddr"); 1521 "CONNECT_REQ", "Called pty subaddr");
1522 ignore_cstruct_param(cs, cmsg->CallingPartySubaddress, 1522 ignore_cstruct_param(cs, cmsg->CallingPartySubaddress,
1523 "CONNECT_REQ", "Calling pty subaddr"); 1523 "CONNECT_REQ", "Calling pty subaddr");
1524 ignore_cstruct_param(cs, cmsg->LLC, 1524 ignore_cstruct_param(cs, cmsg->LLC,
1525 "CONNECT_REQ", "LLC"); 1525 "CONNECT_REQ", "LLC");
1526 if (cmsg->AdditionalInfo != CAPI_DEFAULT) { 1526 if (cmsg->AdditionalInfo != CAPI_DEFAULT) {
1527 ignore_cstruct_param(cs, cmsg->BChannelinformation, 1527 ignore_cstruct_param(cs, cmsg->BChannelinformation,
1528 "CONNECT_REQ", "B Channel Information"); 1528 "CONNECT_REQ", "B Channel Information");
1529 ignore_cstruct_param(cs, cmsg->Keypadfacility, 1529 ignore_cstruct_param(cs, cmsg->Keypadfacility,
1530 "CONNECT_REQ", "Keypad Facility"); 1530 "CONNECT_REQ", "Keypad Facility");
1531 ignore_cstruct_param(cs, cmsg->Useruserdata, 1531 ignore_cstruct_param(cs, cmsg->Useruserdata,
1532 "CONNECT_REQ", "User-User Data"); 1532 "CONNECT_REQ", "User-User Data");
1533 ignore_cstruct_param(cs, cmsg->Facilitydataarray, 1533 ignore_cstruct_param(cs, cmsg->Facilitydataarray,
1534 "CONNECT_REQ", "Facility Data Array"); 1534 "CONNECT_REQ", "Facility Data Array");
1535 } 1535 }
1536 1536
1537 /* encode parameter: B channel to use */ 1537 /* encode parameter: B channel to use */
@@ -1602,7 +1602,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
1602 if (oap != ap) { 1602 if (oap != ap) {
1603 spin_unlock_irqrestore(&bcs->aplock, flags); 1603 spin_unlock_irqrestore(&bcs->aplock, flags);
1604 send_disconnect_ind(bcs, oap, 1604 send_disconnect_ind(bcs, oap,
1605 CapiCallGivenToOtherApplication); 1605 CapiCallGivenToOtherApplication);
1606 spin_lock_irqsave(&bcs->aplock, flags); 1606 spin_lock_irqsave(&bcs->aplock, flags);
1607 } 1607 }
1608 } 1608 }
@@ -1619,7 +1619,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
1619 if (cmsg->BProtocol == CAPI_DEFAULT) { 1619 if (cmsg->BProtocol == CAPI_DEFAULT) {
1620 bcs->proto2 = L2_HDLC; 1620 bcs->proto2 = L2_HDLC;
1621 dev_warn(cs->dev, 1621 dev_warn(cs->dev,
1622 "B2 Protocol X.75 SLP unsupported, using Transparent\n"); 1622 "B2 Protocol X.75 SLP unsupported, using Transparent\n");
1623 } else { 1623 } else {
1624 switch (cmsg->B1protocol) { 1624 switch (cmsg->B1protocol) {
1625 case 0: 1625 case 0:
@@ -1630,46 +1630,46 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
1630 break; 1630 break;
1631 default: 1631 default:
1632 dev_warn(cs->dev, 1632 dev_warn(cs->dev,
1633 "B1 Protocol %u unsupported, using Transparent\n", 1633 "B1 Protocol %u unsupported, using Transparent\n",
1634 cmsg->B1protocol); 1634 cmsg->B1protocol);
1635 bcs->proto2 = L2_VOICE; 1635 bcs->proto2 = L2_VOICE;
1636 } 1636 }
1637 if (cmsg->B2protocol != 1) 1637 if (cmsg->B2protocol != 1)
1638 dev_warn(cs->dev, 1638 dev_warn(cs->dev,
1639 "B2 Protocol %u unsupported, using Transparent\n", 1639 "B2 Protocol %u unsupported, using Transparent\n",
1640 cmsg->B2protocol); 1640 cmsg->B2protocol);
1641 if (cmsg->B3protocol != 0) 1641 if (cmsg->B3protocol != 0)
1642 dev_warn(cs->dev, 1642 dev_warn(cs->dev,
1643 "B3 Protocol %u unsupported, using Transparent\n", 1643 "B3 Protocol %u unsupported, using Transparent\n",
1644 cmsg->B3protocol); 1644 cmsg->B3protocol);
1645 ignore_cstruct_param(cs, cmsg->B1configuration, 1645 ignore_cstruct_param(cs, cmsg->B1configuration,
1646 "CONNECT_RESP", "B1 Configuration"); 1646 "CONNECT_RESP", "B1 Configuration");
1647 ignore_cstruct_param(cs, cmsg->B2configuration, 1647 ignore_cstruct_param(cs, cmsg->B2configuration,
1648 "CONNECT_RESP", "B2 Configuration"); 1648 "CONNECT_RESP", "B2 Configuration");
1649 ignore_cstruct_param(cs, cmsg->B3configuration, 1649 ignore_cstruct_param(cs, cmsg->B3configuration,
1650 "CONNECT_RESP", "B3 Configuration"); 1650 "CONNECT_RESP", "B3 Configuration");
1651 } 1651 }
1652 1652
1653 /* ToDo: check/encode remaining parameters */ 1653 /* ToDo: check/encode remaining parameters */
1654 ignore_cstruct_param(cs, cmsg->ConnectedNumber, 1654 ignore_cstruct_param(cs, cmsg->ConnectedNumber,
1655 "CONNECT_RESP", "Connected Number"); 1655 "CONNECT_RESP", "Connected Number");
1656 ignore_cstruct_param(cs, cmsg->ConnectedSubaddress, 1656 ignore_cstruct_param(cs, cmsg->ConnectedSubaddress,
1657 "CONNECT_RESP", "Connected Subaddress"); 1657 "CONNECT_RESP", "Connected Subaddress");
1658 ignore_cstruct_param(cs, cmsg->LLC, 1658 ignore_cstruct_param(cs, cmsg->LLC,
1659 "CONNECT_RESP", "LLC"); 1659 "CONNECT_RESP", "LLC");
1660 if (cmsg->AdditionalInfo != CAPI_DEFAULT) { 1660 if (cmsg->AdditionalInfo != CAPI_DEFAULT) {
1661 ignore_cstruct_param(cs, cmsg->BChannelinformation, 1661 ignore_cstruct_param(cs, cmsg->BChannelinformation,
1662 "CONNECT_RESP", "BChannel Information"); 1662 "CONNECT_RESP", "BChannel Information");
1663 ignore_cstruct_param(cs, cmsg->Keypadfacility, 1663 ignore_cstruct_param(cs, cmsg->Keypadfacility,
1664 "CONNECT_RESP", "Keypad Facility"); 1664 "CONNECT_RESP", "Keypad Facility");
1665 ignore_cstruct_param(cs, cmsg->Useruserdata, 1665 ignore_cstruct_param(cs, cmsg->Useruserdata,
1666 "CONNECT_RESP", "User-User Data"); 1666 "CONNECT_RESP", "User-User Data");
1667 ignore_cstruct_param(cs, cmsg->Facilitydataarray, 1667 ignore_cstruct_param(cs, cmsg->Facilitydataarray,
1668 "CONNECT_RESP", "Facility Data Array"); 1668 "CONNECT_RESP", "Facility Data Array");
1669 } 1669 }
1670 1670
1671 /* Accept call */ 1671 /* Accept call */
1672 if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state, 1672 if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
1673 EV_ACCEPT, NULL, 0, NULL)) 1673 EV_ACCEPT, NULL, 0, NULL))
1674 return; 1674 return;
1675 gigaset_schedule_event(cs); 1675 gigaset_schedule_event(cs);
@@ -1712,7 +1712,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
1712 if (oap != ap) { 1712 if (oap != ap) {
1713 spin_unlock_irqrestore(&bcs->aplock, flags); 1713 spin_unlock_irqrestore(&bcs->aplock, flags);
1714 send_disconnect_ind(bcs, oap, 1714 send_disconnect_ind(bcs, oap,
1715 CapiCallGivenToOtherApplication); 1715 CapiCallGivenToOtherApplication);
1716 spin_lock_irqsave(&bcs->aplock, flags); 1716 spin_lock_irqsave(&bcs->aplock, flags);
1717 } 1717 }
1718 } 1718 }
@@ -1723,7 +1723,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
1723 /* reject call - will trigger DISCONNECT_IND for this app */ 1723 /* reject call - will trigger DISCONNECT_IND for this app */
1724 dev_info(cs->dev, "%s: Reject=%x\n", 1724 dev_info(cs->dev, "%s: Reject=%x\n",
1725 "CONNECT_RESP", cmsg->Reject); 1725 "CONNECT_RESP", cmsg->Reject);
1726 if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state, 1726 if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
1727 EV_HUP, NULL, 0, NULL)) 1727 EV_HUP, NULL, 0, NULL))
1728 return; 1728 return;
1729 gigaset_schedule_event(cs); 1729 gigaset_schedule_event(cs);
@@ -1756,7 +1756,7 @@ static void do_connect_b3_req(struct gigaset_capi_ctr *iif,
1756 send_conf(iif, ap, skb, CapiIllContrPlciNcci); 1756 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
1757 return; 1757 return;
1758 } 1758 }
1759 bcs = &cs->bcs[channel-1]; 1759 bcs = &cs->bcs[channel - 1];
1760 1760
1761 /* mark logical connection active */ 1761 /* mark logical connection active */
1762 bcs->apconnstate = APCONN_ACTIVE; 1762 bcs->apconnstate = APCONN_ACTIVE;
@@ -1767,7 +1767,7 @@ static void do_connect_b3_req(struct gigaset_capi_ctr *iif,
1767 /* NCPI parameter: not applicable for B3 Transparent */ 1767 /* NCPI parameter: not applicable for B3 Transparent */
1768 ignore_cstruct_param(cs, cmsg->NCPI, "CONNECT_B3_REQ", "NCPI"); 1768 ignore_cstruct_param(cs, cmsg->NCPI, "CONNECT_B3_REQ", "NCPI");
1769 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ? 1769 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ?
1770 CapiNcpiNotSupportedByProtocol : CapiSuccess); 1770 CapiNcpiNotSupportedByProtocol : CapiSuccess);
1771} 1771}
1772 1772
1773/* 1773/*
@@ -1801,7 +1801,7 @@ static void do_connect_b3_resp(struct gigaset_capi_ctr *iif,
1801 dev_kfree_skb_any(skb); 1801 dev_kfree_skb_any(skb);
1802 return; 1802 return;
1803 } 1803 }
1804 bcs = &cs->bcs[channel-1]; 1804 bcs = &cs->bcs[channel - 1];
1805 1805
1806 if (cmsg->Reject) { 1806 if (cmsg->Reject) {
1807 /* Reject: clear B3 connect received flag */ 1807 /* Reject: clear B3 connect received flag */
@@ -1905,7 +1905,7 @@ static void do_disconnect_req(struct gigaset_capi_ctr *iif,
1905 return; 1905 return;
1906 } 1906 }
1907 capi_cmsg2message(b3cmsg, 1907 capi_cmsg2message(b3cmsg,
1908 __skb_put(b3skb, CAPI_DISCONNECT_B3_IND_BASELEN)); 1908 __skb_put(b3skb, CAPI_DISCONNECT_B3_IND_BASELEN));
1909 kfree(b3cmsg); 1909 kfree(b3cmsg);
1910 capi_ctr_handle_message(&iif->ctr, ap->id, b3skb); 1910 capi_ctr_handle_message(&iif->ctr, ap->id, b3skb);
1911 } 1911 }
@@ -1947,7 +1947,7 @@ static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif,
1947 send_conf(iif, ap, skb, CapiIllContrPlciNcci); 1947 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
1948 return; 1948 return;
1949 } 1949 }
1950 bcs = &cs->bcs[channel-1]; 1950 bcs = &cs->bcs[channel - 1];
1951 1951
1952 /* reject if logical connection not active */ 1952 /* reject if logical connection not active */
1953 if (bcs->apconnstate < APCONN_ACTIVE) { 1953 if (bcs->apconnstate < APCONN_ACTIVE) {
@@ -1965,9 +1965,9 @@ static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif,
1965 1965
1966 /* NCPI parameter: not applicable for B3 Transparent */ 1966 /* NCPI parameter: not applicable for B3 Transparent */
1967 ignore_cstruct_param(cs, cmsg->NCPI, 1967 ignore_cstruct_param(cs, cmsg->NCPI,
1968 "DISCONNECT_B3_REQ", "NCPI"); 1968 "DISCONNECT_B3_REQ", "NCPI");
1969 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ? 1969 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ?
1970 CapiNcpiNotSupportedByProtocol : CapiSuccess); 1970 CapiNcpiNotSupportedByProtocol : CapiSuccess);
1971} 1971}
1972 1972
1973/* 1973/*
@@ -1997,7 +1997,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif,
1997 send_conf(iif, ap, skb, CapiIllContrPlciNcci); 1997 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
1998 return; 1998 return;
1999 } 1999 }
2000 bcs = &cs->bcs[channel-1]; 2000 bcs = &cs->bcs[channel - 1];
2001 if (msglen != CAPI_DATA_B3_REQ_LEN && msglen != CAPI_DATA_B3_REQ_LEN64) 2001 if (msglen != CAPI_DATA_B3_REQ_LEN && msglen != CAPI_DATA_B3_REQ_LEN64)
2002 dev_notice(cs->dev, "%s: unexpected length %d\n", 2002 dev_notice(cs->dev, "%s: unexpected length %d\n",
2003 "DATA_B3_REQ", msglen); 2003 "DATA_B3_REQ", msglen);
@@ -2040,7 +2040,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif,
2040 if (!(flags & CAPI_FLAGS_DELIVERY_CONFIRMATION)) 2040 if (!(flags & CAPI_FLAGS_DELIVERY_CONFIRMATION))
2041 send_data_b3_conf(cs, &iif->ctr, ap->id, msgid, channel, handle, 2041 send_data_b3_conf(cs, &iif->ctr, ap->id, msgid, channel, handle,
2042 flags ? CapiFlagsNotSupportedByProtocol 2042 flags ? CapiFlagsNotSupportedByProtocol
2043 : CAPI_NOERROR); 2043 : CAPI_NOERROR);
2044} 2044}
2045 2045
2046/* 2046/*
@@ -2258,11 +2258,11 @@ static int gigaset_proc_show(struct seq_file *m, void *v)
2258 2258
2259 seq_printf(m, "%-16s %s\n", "name", ctr->name); 2259 seq_printf(m, "%-16s %s\n", "name", ctr->name);
2260 seq_printf(m, "%-16s %s %s\n", "dev", 2260 seq_printf(m, "%-16s %s %s\n", "dev",
2261 dev_driver_string(cs->dev), dev_name(cs->dev)); 2261 dev_driver_string(cs->dev), dev_name(cs->dev));
2262 seq_printf(m, "%-16s %d\n", "id", cs->myid); 2262 seq_printf(m, "%-16s %d\n", "id", cs->myid);
2263 if (cs->gotfwver) 2263 if (cs->gotfwver)
2264 seq_printf(m, "%-16s %d.%d.%d.%d\n", "firmware", 2264 seq_printf(m, "%-16s %d.%d.%d.%d\n", "firmware",
2265 cs->fwver[0], cs->fwver[1], cs->fwver[2], cs->fwver[3]); 2265 cs->fwver[0], cs->fwver[1], cs->fwver[2], cs->fwver[3]);
2266 seq_printf(m, "%-16s %d\n", "channels", cs->channels); 2266 seq_printf(m, "%-16s %d\n", "channels", cs->channels);
2267 seq_printf(m, "%-16s %s\n", "onechannel", cs->onechannel ? "yes" : "no"); 2267 seq_printf(m, "%-16s %s\n", "onechannel", cs->onechannel ? "yes" : "no");
2268 2268
@@ -2315,13 +2315,13 @@ static int gigaset_proc_show(struct seq_file *m, void *v)
2315 2315
2316 for (i = 0; i < cs->channels; i++) { 2316 for (i = 0; i < cs->channels; i++) {
2317 seq_printf(m, "[%d]%-13s %d\n", i, "corrupted", 2317 seq_printf(m, "[%d]%-13s %d\n", i, "corrupted",
2318 cs->bcs[i].corrupted); 2318 cs->bcs[i].corrupted);
2319 seq_printf(m, "[%d]%-13s %d\n", i, "trans_down", 2319 seq_printf(m, "[%d]%-13s %d\n", i, "trans_down",
2320 cs->bcs[i].trans_down); 2320 cs->bcs[i].trans_down);
2321 seq_printf(m, "[%d]%-13s %d\n", i, "trans_up", 2321 seq_printf(m, "[%d]%-13s %d\n", i, "trans_up",
2322 cs->bcs[i].trans_up); 2322 cs->bcs[i].trans_up);
2323 seq_printf(m, "[%d]%-13s %d\n", i, "chstate", 2323 seq_printf(m, "[%d]%-13s %d\n", i, "chstate",
2324 cs->bcs[i].chstate); 2324 cs->bcs[i].chstate);
2325 switch (cs->bcs[i].proto2) { 2325 switch (cs->bcs[i].proto2) {
2326 case L2_BITSYNC: 2326 case L2_BITSYNC:
2327 s = "bitsync"; 2327 s = "bitsync";