aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif
diff options
context:
space:
mode:
authorSjur Braendeland <sjur.brandeland@stericsson.com>2010-04-28 04:54:35 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-28 15:55:11 -0400
commite539d83cc8a4fa581cbf8ed288fdadb19a692cb0 (patch)
tree490f94cd943a62b54ead3905b8075c19ce639612 /net/caif
parentd3f744e0d6c1c27a10cdceac6eb946122188dbc9 (diff)
caif: Rename functions in cfcnfg and caif_dev
Changes: o Renamed cfcnfg_del_adapt_layer to cfcnfg_disconn_adapt_layer o Fixed typo cfcfg to cfcnfg o Renamed linkid to channel_id o Updated documentation in caif_dev.h o Minor formatting changes Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r--net/caif/caif_dev.c15
-rw-r--r--net/caif/cfcnfg.c51
2 files changed, 32 insertions, 34 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index e84837e1bc86..be1f674a3b67 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -330,20 +330,19 @@ int caif_connect_client(struct caif_connect_request *conn_req,
330 struct cflayer *client_layer) 330 struct cflayer *client_layer)
331{ 331{
332 struct cfctrl_link_param param; 332 struct cfctrl_link_param param;
333 if (connect_req_to_link_param(get_caif_conf(), conn_req, &param) == 0) 333 int ret;
334 /* Hook up the adaptation layer. */ 334 ret = connect_req_to_link_param(get_caif_conf(), conn_req, &param);
335 return cfcnfg_add_adaptation_layer(get_caif_conf(), 335 if (ret)
336 return ret;
337 /* Hook up the adaptation layer. */
338 return cfcnfg_add_adaptation_layer(get_caif_conf(),
336 &param, client_layer); 339 &param, client_layer);
337
338 return -EINVAL;
339
340 caif_assert(0);
341} 340}
342EXPORT_SYMBOL(caif_connect_client); 341EXPORT_SYMBOL(caif_connect_client);
343 342
344int caif_disconnect_client(struct cflayer *adap_layer) 343int caif_disconnect_client(struct cflayer *adap_layer)
345{ 344{
346 return cfcnfg_del_adapt_layer(get_caif_conf(), adap_layer); 345 return cfcnfg_disconn_adapt_layer(get_caif_conf(), adap_layer);
347} 346}
348EXPORT_SYMBOL(caif_disconnect_client); 347EXPORT_SYMBOL(caif_disconnect_client);
349 348
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index c873e3d4387c..d52f2566916e 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -51,12 +51,12 @@ struct cfcnfg {
51 struct cfcnfg_phyinfo phy_layers[MAX_PHY_LAYERS]; 51 struct cfcnfg_phyinfo phy_layers[MAX_PHY_LAYERS];
52}; 52};
53 53
54static void cncfg_linkup_rsp(struct cflayer *layer, u8 linkid, 54static void cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id,
55 enum cfctrl_srv serv, u8 phyid, 55 enum cfctrl_srv serv, u8 phyid,
56 struct cflayer *adapt_layer); 56 struct cflayer *adapt_layer);
57static void cncfg_linkdestroy_rsp(struct cflayer *layer, u8 linkid, 57static void cfcnfg_linkdestroy_rsp(struct cflayer *layer, u8 channel_id,
58 struct cflayer *client_layer); 58 struct cflayer *client_layer);
59static void cncfg_reject_rsp(struct cflayer *layer, u8 linkid, 59static void cfcnfg_reject_rsp(struct cflayer *layer, u8 channel_id,
60 struct cflayer *adapt_layer); 60 struct cflayer *adapt_layer);
61static void cfctrl_resp_func(void); 61static void cfctrl_resp_func(void);
62static void cfctrl_enum_resp(void); 62static void cfctrl_enum_resp(void);
@@ -82,13 +82,13 @@ struct cfcnfg *cfcnfg_create(void)
82 resp = cfctrl_get_respfuncs(this->ctrl); 82 resp = cfctrl_get_respfuncs(this->ctrl);
83 resp->enum_rsp = cfctrl_enum_resp; 83 resp->enum_rsp = cfctrl_enum_resp;
84 resp->linkerror_ind = cfctrl_resp_func; 84 resp->linkerror_ind = cfctrl_resp_func;
85 resp->linkdestroy_rsp = cncfg_linkdestroy_rsp; 85 resp->linkdestroy_rsp = cfcnfg_linkdestroy_rsp;
86 resp->sleep_rsp = cfctrl_resp_func; 86 resp->sleep_rsp = cfctrl_resp_func;
87 resp->wake_rsp = cfctrl_resp_func; 87 resp->wake_rsp = cfctrl_resp_func;
88 resp->restart_rsp = cfctrl_resp_func; 88 resp->restart_rsp = cfctrl_resp_func;
89 resp->radioset_rsp = cfctrl_resp_func; 89 resp->radioset_rsp = cfctrl_resp_func;
90 resp->linksetup_rsp = cncfg_linkup_rsp; 90 resp->linksetup_rsp = cfcnfg_linkup_rsp;
91 resp->reject_rsp = cncfg_reject_rsp; 91 resp->reject_rsp = cfcnfg_reject_rsp;
92 92
93 this->last_phyid = 1; 93 this->last_phyid = 1;
94 94
@@ -191,8 +191,7 @@ int cfcnfg_get_named(struct cfcnfg *cnfg, char *name)
191 * 4) Link-Error - (no response) 191 * 4) Link-Error - (no response)
192 * Not handled, but this should be a CAIF PROTOCOL ERROR 192 * Not handled, but this should be a CAIF PROTOCOL ERROR
193 */ 193 */
194 194int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
195int cfcnfg_del_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
196{ 195{
197 u8 channel_id = 0; 196 u8 channel_id = 0;
198 int ret = 0; 197 int ret = 0;
@@ -246,9 +245,9 @@ end:
246 return ret; 245 return ret;
247 246
248} 247}
249EXPORT_SYMBOL(cfcnfg_del_adapt_layer); 248EXPORT_SYMBOL(cfcnfg_disconn_adapt_layer);
250 249
251static void cncfg_linkdestroy_rsp(struct cflayer *layer, u8 linkid, 250static void cfcnfg_linkdestroy_rsp(struct cflayer *layer, u8 channel_id,
252 struct cflayer *client_layer) 251 struct cflayer *client_layer)
253{ 252{
254 struct cfcnfg *cnfg = container_obj(layer); 253 struct cfcnfg *cnfg = container_obj(layer);
@@ -258,20 +257,20 @@ static void cncfg_linkdestroy_rsp(struct cflayer *layer, u8 linkid,
258 * 1) Remove service from the MUX layer. The MUX must 257 * 1) Remove service from the MUX layer. The MUX must
259 * guarante that no more payload sent "upwards" (receive) 258 * guarante that no more payload sent "upwards" (receive)
260 */ 259 */
261 servl = cfmuxl_remove_uplayer(cnfg->mux, linkid); 260 servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id);
262 261
263 if (servl == NULL) { 262 if (servl == NULL) {
264 pr_err("CAIF: %s(): PROTOCOL ERROR " 263 pr_err("CAIF: %s(): PROTOCOL ERROR "
265 "- Error removing service_layer Linkid(%d)", 264 "- Error removing service_layer Channel_Id(%d)",
266 __func__, linkid); 265 __func__, channel_id);
267 return; 266 return;
268 } 267 }
269 caif_assert(linkid == servl->id); 268 caif_assert(channel_id == servl->id);
270 269
271 if (servl != client_layer && servl->up != client_layer) { 270 if (servl != client_layer && servl->up != client_layer) {
272 pr_err("CAIF: %s(): Error removing service_layer " 271 pr_err("CAIF: %s(): Error removing service_layer "
273 "Linkid(%d) %p %p", 272 "Channel_Id(%d) %p %p",
274 __func__, linkid, (void *) servl, 273 __func__, channel_id, (void *) servl,
275 (void *) client_layer); 274 (void *) client_layer);
276 return; 275 return;
277 } 276 }
@@ -345,7 +344,7 @@ cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg,
345} 344}
346EXPORT_SYMBOL(cfcnfg_add_adaptation_layer); 345EXPORT_SYMBOL(cfcnfg_add_adaptation_layer);
347 346
348static void cncfg_reject_rsp(struct cflayer *layer, u8 linkid, 347static void cfcnfg_reject_rsp(struct cflayer *layer, u8 channel_id,
349 struct cflayer *adapt_layer) 348 struct cflayer *adapt_layer)
350{ 349{
351 if (adapt_layer != NULL && adapt_layer->ctrlcmd != NULL) 350 if (adapt_layer != NULL && adapt_layer->ctrlcmd != NULL)
@@ -354,7 +353,7 @@ static void cncfg_reject_rsp(struct cflayer *layer, u8 linkid,
354} 353}
355 354
356static void 355static void
357cncfg_linkup_rsp(struct cflayer *layer, u8 linkid, enum cfctrl_srv serv, 356cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
358 u8 phyid, struct cflayer *adapt_layer) 357 u8 phyid, struct cflayer *adapt_layer)
359{ 358{
360 struct cfcnfg *cnfg = container_obj(layer); 359 struct cfcnfg *cnfg = container_obj(layer);
@@ -383,26 +382,26 @@ cncfg_linkup_rsp(struct cflayer *layer, u8 linkid, enum cfctrl_srv serv,
383 _CAIF_MODEMCMD_PHYIF_USEFULL); 382 _CAIF_MODEMCMD_PHYIF_USEFULL);
384 383
385 } 384 }
386 adapt_layer->id = linkid; 385 adapt_layer->id = channel_id;
387 386
388 switch (serv) { 387 switch (serv) {
389 case CFCTRL_SRV_VEI: 388 case CFCTRL_SRV_VEI:
390 servicel = cfvei_create(linkid, &phyinfo->dev_info); 389 servicel = cfvei_create(channel_id, &phyinfo->dev_info);
391 break; 390 break;
392 case CFCTRL_SRV_DATAGRAM: 391 case CFCTRL_SRV_DATAGRAM:
393 servicel = cfdgml_create(linkid, &phyinfo->dev_info); 392 servicel = cfdgml_create(channel_id, &phyinfo->dev_info);
394 break; 393 break;
395 case CFCTRL_SRV_RFM: 394 case CFCTRL_SRV_RFM:
396 servicel = cfrfml_create(linkid, &phyinfo->dev_info); 395 servicel = cfrfml_create(channel_id, &phyinfo->dev_info);
397 break; 396 break;
398 case CFCTRL_SRV_UTIL: 397 case CFCTRL_SRV_UTIL:
399 servicel = cfutill_create(linkid, &phyinfo->dev_info); 398 servicel = cfutill_create(channel_id, &phyinfo->dev_info);
400 break; 399 break;
401 case CFCTRL_SRV_VIDEO: 400 case CFCTRL_SRV_VIDEO:
402 servicel = cfvidl_create(linkid, &phyinfo->dev_info); 401 servicel = cfvidl_create(channel_id, &phyinfo->dev_info);
403 break; 402 break;
404 case CFCTRL_SRV_DBG: 403 case CFCTRL_SRV_DBG:
405 servicel = cfdbgl_create(linkid, &phyinfo->dev_info); 404 servicel = cfdbgl_create(channel_id, &phyinfo->dev_info);
406 break; 405 break;
407 default: 406 default:
408 pr_err("CAIF: %s(): Protocol error. " 407 pr_err("CAIF: %s(): Protocol error. "
@@ -415,7 +414,7 @@ cncfg_linkup_rsp(struct cflayer *layer, u8 linkid, enum cfctrl_srv serv,
415 return; 414 return;
416 } 415 }
417 layer_set_dn(servicel, cnfg->mux); 416 layer_set_dn(servicel, cnfg->mux);
418 cfmuxl_set_uplayer(cnfg->mux, servicel, linkid); 417 cfmuxl_set_uplayer(cnfg->mux, servicel, channel_id);
419 layer_set_up(servicel, adapt_layer); 418 layer_set_up(servicel, adapt_layer);
420 layer_set_dn(adapt_layer, servicel); 419 layer_set_dn(adapt_layer, servicel);
421 servicel->ctrlcmd(servicel, CAIF_CTRLCMD_INIT_RSP, 0); 420 servicel->ctrlcmd(servicel, CAIF_CTRLCMD_INIT_RSP, 0);