]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/caif/caif_config_util.c
Merge branch 'upstream/blkfront' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / net / caif / caif_config_util.c
index 6f36580366f0c2c5ecd1347f72098aaf06d78e5a..d522d8c1703e761eb27b4e2375eff9851b06690e 100644 (file)
@@ -16,11 +16,18 @@ int connect_req_to_link_param(struct cfcnfg *cnfg,
 {
        struct dev_info *dev_info;
        enum cfcnfg_phy_preference pref;
+       int res;
+
        memset(l, 0, sizeof(*l));
-       l->priority = s->priority;
+       /* In caif protocol low value is high priority */
+       l->priority = CAIF_PRIO_MAX - s->priority + 1;
 
-       if (s->link_name[0] != '\0')
-               l->phyid = cfcnfg_get_named(cnfg, s->link_name);
+       if (s->ifindex != 0){
+               res = cfcnfg_get_id_from_ifi(cnfg, s->ifindex);
+               if (res < 0)
+                       return res;
+               l->phyid = res;
+       }
        else {
                switch (s->link_selector) {
                case CAIF_LINK_HIGH_BANDW:
@@ -79,6 +86,11 @@ int connect_req_to_link_param(struct cfcnfg *cnfg,
                memcpy(l->u.utility.params, s->param.data,
                       l->u.utility.paramlen);
 
+               break;
+       case CAIFPROTO_DEBUG:
+               l->linktype = CFCTRL_SRV_DBG;
+               l->endpoint = s->sockaddr.u.dbg.service;
+               l->chtype = s->sockaddr.u.dbg.type;
                break;
        default:
                return -EINVAL;