|
@@ -4,6 +4,8 @@
|
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
|
*/
|
|
|
|
|
|
+#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
|
|
|
+
|
|
|
#include <linux/stddef.h>
|
|
|
#include <linux/spinlock.h>
|
|
|
#include <linux/slab.h>
|
|
@@ -36,7 +38,7 @@ struct cflayer *cfctrl_create(void)
|
|
|
struct cfctrl *this =
|
|
|
kmalloc(sizeof(struct cfctrl), GFP_ATOMIC);
|
|
|
if (!this) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return NULL;
|
|
|
}
|
|
|
caif_assert(offsetof(struct cfctrl, serv.layer) == 0);
|
|
@@ -132,9 +134,7 @@ struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl,
|
|
|
list_for_each_entry_safe(p, tmp, &ctrl->list, list) {
|
|
|
if (cfctrl_req_eq(req, p)) {
|
|
|
if (p != first)
|
|
|
- pr_warning("CAIF: %s(): Requests are not "
|
|
|
- "received in order\n",
|
|
|
- __func__);
|
|
|
+ pr_warn("Requests are not received in order\n");
|
|
|
|
|
|
atomic_set(&ctrl->rsp_seq_no,
|
|
|
p->sequence_no);
|
|
@@ -177,7 +177,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid)
|
|
|
int ret;
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return;
|
|
|
}
|
|
|
caif_assert(offsetof(struct cfctrl, serv.layer) == 0);
|
|
@@ -189,8 +189,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid)
|
|
|
ret =
|
|
|
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
|
|
|
if (ret < 0) {
|
|
|
- pr_err("CAIF: %s(): Could not transmit enum message\n",
|
|
|
- __func__);
|
|
|
+ pr_err("Could not transmit enum message\n");
|
|
|
cfpkt_destroy(pkt);
|
|
|
}
|
|
|
}
|
|
@@ -208,7 +207,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
|
|
|
char utility_name[16];
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_SETUP);
|
|
@@ -253,13 +252,13 @@ int cfctrl_linkup_request(struct cflayer *layer,
|
|
|
param->u.utility.paramlen);
|
|
|
break;
|
|
|
default:
|
|
|
- pr_warning("CAIF: %s():Request setup of bad link type = %d\n",
|
|
|
- __func__, param->linktype);
|
|
|
+ pr_warn("Request setup of bad link type = %d\n",
|
|
|
+ param->linktype);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
|
|
if (!req) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
req->client_layer = user_layer;
|
|
@@ -276,8 +275,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
|
|
|
ret =
|
|
|
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
|
|
|
if (ret < 0) {
|
|
|
- pr_err("CAIF: %s(): Could not transmit linksetup request\n",
|
|
|
- __func__);
|
|
|
+ pr_err("Could not transmit linksetup request\n");
|
|
|
cfpkt_destroy(pkt);
|
|
|
return -ENODEV;
|
|
|
}
|
|
@@ -291,7 +289,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid,
|
|
|
struct cfctrl *cfctrl = container_obj(layer);
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_DESTROY);
|
|
@@ -300,8 +298,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid,
|
|
|
ret =
|
|
|
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
|
|
|
if (ret < 0) {
|
|
|
- pr_err("CAIF: %s(): Could not transmit link-down request\n",
|
|
|
- __func__);
|
|
|
+ pr_err("Could not transmit link-down request\n");
|
|
|
cfpkt_destroy(pkt);
|
|
|
}
|
|
|
return ret;
|
|
@@ -313,7 +310,7 @@ void cfctrl_sleep_req(struct cflayer *layer)
|
|
|
struct cfctrl *cfctrl = container_obj(layer);
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return;
|
|
|
}
|
|
|
cfpkt_addbdy(pkt, CFCTRL_CMD_SLEEP);
|
|
@@ -330,7 +327,7 @@ void cfctrl_wake_req(struct cflayer *layer)
|
|
|
struct cfctrl *cfctrl = container_obj(layer);
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return;
|
|
|
}
|
|
|
cfpkt_addbdy(pkt, CFCTRL_CMD_WAKE);
|
|
@@ -347,7 +344,7 @@ void cfctrl_getstartreason_req(struct cflayer *layer)
|
|
|
struct cfctrl *cfctrl = container_obj(layer);
|
|
|
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
|
|
|
if (!pkt) {
|
|
|
- pr_warning("CAIF: %s(): Out of memory\n", __func__);
|
|
|
+ pr_warn("Out of memory\n");
|
|
|
return;
|
|
|
}
|
|
|
cfpkt_addbdy(pkt, CFCTRL_CMD_START_REASON);
|
|
@@ -364,12 +361,11 @@ void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer)
|
|
|
struct cfctrl_request_info *p, *tmp;
|
|
|
struct cfctrl *ctrl = container_obj(layr);
|
|
|
spin_lock(&ctrl->info_list_lock);
|
|
|
- pr_warning("CAIF: %s(): enter\n", __func__);
|
|
|
+ pr_warn("enter\n");
|
|
|
|
|
|
list_for_each_entry_safe(p, tmp, &ctrl->list, list) {
|
|
|
if (p->client_layer == adap_layer) {
|
|
|
- pr_warning("CAIF: %s(): cancel req :%d\n", __func__,
|
|
|
- p->sequence_no);
|
|
|
+ pr_warn("cancel req :%d\n", p->sequence_no);
|
|
|
list_del(&p->list);
|
|
|
kfree(p);
|
|
|
}
|
|
@@ -520,9 +516,8 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
|
|
|
cfpkt_extr_head(pkt, ¶m, len);
|
|
|
break;
|
|
|
default:
|
|
|
- pr_warning("CAIF: %s(): Request setup "
|
|
|
- "- invalid link type (%d)",
|
|
|
- __func__, serv);
|
|
|
+ pr_warn("Request setup - invalid link type (%d)\n",
|
|
|
+ serv);
|
|
|
goto error;
|
|
|
}
|
|
|
|
|
@@ -532,9 +527,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
|
|
|
|
|
|
if (CFCTRL_ERR_BIT == (CFCTRL_ERR_BIT & cmdrsp) ||
|
|
|
cfpkt_erroneous(pkt)) {
|
|
|
- pr_err("CAIF: %s(): Invalid O/E bit or parse "
|
|
|
- "error on CAIF control channel",
|
|
|
- __func__);
|
|
|
+ pr_err("Invalid O/E bit or parse error on CAIF control channel\n");
|
|
|
cfctrl->res.reject_rsp(cfctrl->serv.layer.up,
|
|
|
0,
|
|
|
req ? req->client_layer
|
|
@@ -556,8 +549,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
|
|
|
cfctrl->res.linkdestroy_rsp(cfctrl->serv.layer.up, linkid);
|
|
|
break;
|
|
|
case CFCTRL_CMD_LINK_ERR:
|
|
|
- pr_err("CAIF: %s(): Frame Error Indication received\n",
|
|
|
- __func__);
|
|
|
+ pr_err("Frame Error Indication received\n");
|
|
|
cfctrl->res.linkerror_ind();
|
|
|
break;
|
|
|
case CFCTRL_CMD_ENUM:
|
|
@@ -576,7 +568,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
|
|
|
cfctrl->res.radioset_rsp();
|
|
|
break;
|
|
|
default:
|
|
|
- pr_err("CAIF: %s(): Unrecognized Control Frame\n", __func__);
|
|
|
+ pr_err("Unrecognized Control Frame\n");
|
|
|
goto error;
|
|
|
break;
|
|
|
}
|
|
@@ -595,8 +587,7 @@ static void cfctrl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
|
|
|
case CAIF_CTRLCMD_FLOW_OFF_IND:
|
|
|
spin_lock(&this->info_list_lock);
|
|
|
if (!list_empty(&this->list)) {
|
|
|
- pr_debug("CAIF: %s(): Received flow off in "
|
|
|
- "control layer", __func__);
|
|
|
+ pr_debug("Received flow off in control layer\n");
|
|
|
}
|
|
|
spin_unlock(&this->info_list_lock);
|
|
|
break;
|
|
@@ -620,7 +611,7 @@ static int handle_loop(struct cfctrl *ctrl, int cmd, struct cfpkt *pkt)
|
|
|
if (!ctrl->loop_linkused[linkid])
|
|
|
goto found;
|
|
|
spin_unlock(&ctrl->loop_linkid_lock);
|
|
|
- pr_err("CAIF: %s(): Out of link-ids\n", __func__);
|
|
|
+ pr_err("Out of link-ids\n");
|
|
|
return -EINVAL;
|
|
|
found:
|
|
|
if (!ctrl->loop_linkused[linkid])
|