summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-05-12 14:27:25 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2010-05-12 14:27:25 +1000
commit0e0b8a79665aa7843f35d64337c1afd39c0d8f22 (patch)
tree3491a1c0456526bf24cee9c40122e645f92c2baa
parent1de98cfeb54ab226e8ed8b3dd0a244bbf61fe1ed (diff)
parent32d12e8cd19f86d424cab68a29c9f09a3fe97259 (diff)
Merge remote branch 'uwb/for-upstream'
-rw-r--r--drivers/uwb/i1480/i1480u-wlp/lc.c16
-rw-r--r--drivers/uwb/wlp/messages.c40
-rw-r--r--drivers/uwb/wlp/sysfs.c46
-rw-r--r--drivers/uwb/wlp/wlp-lc.c12
-rw-r--r--include/linux/wlp.h2
5 files changed, 58 insertions, 58 deletions
diff --git a/drivers/uwb/i1480/i1480u-wlp/lc.c b/drivers/uwb/i1480/i1480u-wlp/lc.c
index def778cf2216..daf793559bcf 100644
--- a/drivers/uwb/i1480/i1480u-wlp/lc.c
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c
@@ -93,28 +93,28 @@ void i1480u_init(struct i1480u *i1480u)
* information elements have intuitive mappings, other not.
*/
static
-void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *dev_info)
+void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *wdi)
{
struct i1480u *i1480u = container_of(wlp, struct i1480u, wlp);
struct usb_device *usb_dev = i1480u->usb_dev;
/* Treat device name and model name the same */
if (usb_dev->descriptor.iProduct) {
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->name, sizeof(dev_info->name));
+ wdi->name, sizeof(wdi->name));
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->model_name, sizeof(dev_info->model_name));
+ wdi->model_name, sizeof(wdi->model_name));
}
if (usb_dev->descriptor.iManufacturer)
usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
- dev_info->manufacturer,
- sizeof(dev_info->manufacturer));
- scnprintf(dev_info->model_nr, sizeof(dev_info->model_nr), "%04x",
+ wdi->manufacturer,
+ sizeof(wdi->manufacturer));
+ scnprintf(wdi->model_nr, sizeof(wdi->model_nr), "%04x",
__le16_to_cpu(usb_dev->descriptor.bcdDevice));
if (usb_dev->descriptor.iSerialNumber)
usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
- dev_info->serial, sizeof(dev_info->serial));
+ wdi->serial, sizeof(wdi->serial));
/* FIXME: where should we obtain category? */
- dev_info->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
+ wdi->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
/* FIXME: Complete OUI and OUIsubdiv attributes */
}
diff --git a/drivers/uwb/wlp/messages.c b/drivers/uwb/wlp/messages.c
index 3a8e033dce21..6daa464bed24 100644
--- a/drivers/uwb/wlp/messages.c
+++ b/drivers/uwb/wlp/messages.c
@@ -713,7 +713,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
struct sk_buff *_skb;
void *d1_itr;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -721,7 +721,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
_skb = dev_alloc_skb(sizeof(*_d1)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_wss_sel_mthd)
@@ -795,7 +795,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
void *d2_itr;
size_t mem_needed;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -803,7 +803,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
mem_needed = sizeof(*_d2)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_uuid_r)
@@ -971,7 +971,7 @@ error_parse:
*/
static
int wlp_get_variable_info(struct wlp *wlp, void *data,
- struct wlp_device_info *dev_info, ssize_t len)
+ struct wlp_device_info *wdi, ssize_t len)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
size_t used = 0;
@@ -994,7 +994,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_manufacturer(wlp, data + used,
- dev_info->manufacturer,
+ wdi->manufacturer,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain "
@@ -1012,7 +1012,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_name(wlp, data + used,
- dev_info->model_name,
+ wdi->model_name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1029,7 +1029,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_nr(wlp, data + used,
- dev_info->model_nr,
+ wdi->model_nr,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1046,7 +1046,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_serial(wlp, data + used,
- dev_info->serial, len - used);
+ wdi->serial, len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Serial "
"number attribute from D1 message.\n");
@@ -1062,7 +1062,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_prim_dev_type(wlp, data + used,
- &dev_info->prim_dev_type,
+ &wdi->prim_dev_type,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Primary "
@@ -1070,10 +1070,10 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
"message.\n");
goto error_parse;
}
- dev_info->prim_dev_type.category =
- le16_to_cpu(dev_info->prim_dev_type.category);
- dev_info->prim_dev_type.subID =
- le16_to_cpu(dev_info->prim_dev_type.subID);
+ wdi->prim_dev_type.category =
+ le16_to_cpu(wdi->prim_dev_type.category);
+ wdi->prim_dev_type.subID =
+ le16_to_cpu(wdi->prim_dev_type.subID);
last = WLP_ATTR_PRI_DEV_TYPE;
used += result;
break;
@@ -1099,7 +1099,7 @@ static
int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
struct wlp_uuid *uuid_e,
enum wlp_wss_sel_mthd *sel_mthd,
- struct wlp_device_info *dev_info,
+ struct wlp_device_info *wdi,
enum wlp_assc_error *assc_err)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
@@ -1124,7 +1124,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_dev_name(wlp, ptr + used, dev_info->name,
+ result = wlp_get_dev_name(wlp, ptr + used, wdi->name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Name from D1 "
@@ -1132,7 +1132,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_variable_info(wlp, ptr + used, dev_info, len - used);
+ result = wlp_get_variable_info(wlp, ptr + used, wdi, len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Information from "
"D1 message.\n");
@@ -1172,15 +1172,15 @@ void wlp_handle_d1_frame(struct work_struct *ws)
struct device *dev = &wlp->rc->uwb_dev.dev;
struct wlp_uuid uuid_e;
enum wlp_wss_sel_mthd sel_mthd = 0;
- struct wlp_device_info dev_info;
+ struct wlp_device_info wdi;
enum wlp_assc_error assc_err;
struct sk_buff *resp = NULL;
/* Parse D1 frame */
mutex_lock(&wss->mutex);
mutex_lock(&wlp->mutex); /* to access wlp->uuid */
- memset(&dev_info, 0, sizeof(dev_info));
- result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &dev_info,
+ memset(&wdi, 0, sizeof(wdi));
+ result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &wdi,
&assc_err);
if (result < 0) {
dev_err(dev, "WLP: Unable to parse incoming D1 frame.\n");
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 6627c94cc854..b24751c3430b 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -333,12 +333,12 @@ ssize_t wlp_dev_##type##_show(struct wlp *wlp, char *buf) \
{ \
ssize_t result = 0; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_setup_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->dev_info->type);\
+ result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result; \
@@ -360,14 +360,14 @@ ssize_t wlp_dev_##type##_store(struct wlp *wlp, const char *buf, size_t size)\
ssize_t result; \
char format[10]; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_alloc_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- memset(wlp->dev_info->type, 0, sizeof(wlp->dev_info->type)); \
+ memset(wlp->wdi->type, 0, sizeof(wlp->wdi->type)); \
sprintf(format, "%%%uc", len); \
- result = sscanf(buf, format, wlp->dev_info->type); \
+ result = sscanf(buf, format, wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result < 0 ? result : size; \
@@ -409,13 +409,13 @@ ssize_t wlp_dev_prim_category_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%s\n",
- wlp_dev_category_str(wlp->dev_info->prim_dev_type.category));
+ wlp_dev_category_str(wlp->wdi->prim_dev_type.category));
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -428,7 +428,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
ssize_t result;
u16 cat;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -436,7 +436,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
result = sscanf(buf, "%hu", &cat);
if ((cat >= WLP_DEV_CAT_COMPUTER && cat <= WLP_DEV_CAT_TELEPHONE)
|| cat == WLP_DEV_CAT_OTHER)
- wlp->dev_info->prim_dev_type.category = cat;
+ wlp->wdi->prim_dev_type.category = cat;
else
result = -EINVAL;
out:
@@ -449,15 +449,15 @@ ssize_t wlp_dev_prim_OUI_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x\n",
- wlp->dev_info->prim_dev_type.OUI[0],
- wlp->dev_info->prim_dev_type.OUI[1],
- wlp->dev_info->prim_dev_type.OUI[2]);
+ wlp->wdi->prim_dev_type.OUI[0],
+ wlp->wdi->prim_dev_type.OUI[1],
+ wlp->wdi->prim_dev_type.OUI[2]);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -469,7 +469,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
ssize_t result;
u8 OUI[3];
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -480,7 +480,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
result = -EINVAL;
goto out;
} else
- memcpy(wlp->dev_info->prim_dev_type.OUI, OUI, sizeof(OUI));
+ memcpy(wlp->wdi->prim_dev_type.OUI, OUI, sizeof(OUI));
out:
mutex_unlock(&wlp->mutex);
return result < 0 ? result : size;
@@ -492,13 +492,13 @@ ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.OUIsubdiv);
+ wlp->wdi->prim_dev_type.OUIsubdiv);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -512,14 +512,14 @@ ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *wlp, const char *buf,
unsigned sub;
u8 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.OUIsubdiv = sub;
+ wlp->wdi->prim_dev_type.OUIsubdiv = sub;
else
result = -EINVAL;
out:
@@ -532,13 +532,13 @@ ssize_t wlp_dev_prim_subcat_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.subID);
+ wlp->wdi->prim_dev_type.subID);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -552,14 +552,14 @@ ssize_t wlp_dev_prim_subcat_store(struct wlp *wlp, const char *buf,
unsigned sub;
__le16 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.subID = sub;
+ wlp->wdi->prim_dev_type.subID = sub;
else
result = -EINVAL;
out:
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c
index 7f6a630bf26c..202655d4fc20 100644
--- a/drivers/uwb/wlp/wlp-lc.c
+++ b/drivers/uwb/wlp/wlp-lc.c
@@ -40,9 +40,9 @@ void wlp_neighbor_init(struct wlp_neighbor_e *neighbor)
int __wlp_alloc_device_info(struct wlp *wlp)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
- BUG_ON(wlp->dev_info != NULL);
- wlp->dev_info = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
- if (wlp->dev_info == NULL) {
+ BUG_ON(wlp->wdi != NULL);
+ wlp->wdi = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
+ if (wlp->wdi == NULL) {
dev_err(dev, "WLP: Unable to allocate memory for "
"device information.\n");
return -ENOMEM;
@@ -59,7 +59,7 @@ int __wlp_alloc_device_info(struct wlp *wlp)
static
void __wlp_fill_device_info(struct wlp *wlp)
{
- wlp->fill_device_info(wlp, wlp->dev_info);
+ wlp->fill_device_info(wlp, wlp->wdi);
}
/**
@@ -539,8 +539,8 @@ void wlp_remove(struct wlp *wlp)
uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler);
wlp_eda_release(&wlp->eda);
mutex_lock(&wlp->mutex);
- if (wlp->dev_info != NULL)
- kfree(wlp->dev_info);
+ if (wlp->wdi != NULL)
+ kfree(wlp->wdi);
mutex_unlock(&wlp->mutex);
wlp->rc = NULL;
}
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
index ac95ce6606ac..e8e3ff26da58 100644
--- a/include/linux/wlp.h
+++ b/include/linux/wlp.h
@@ -655,7 +655,7 @@ struct wlp {
struct mutex nbmutex; /* Neighbor mutex protects neighbors list */
struct list_head neighbors; /* Elements are wlp_neighbor_e */
struct uwb_notifs_handler uwb_notifs_handler;
- struct wlp_device_info *dev_info;
+ struct wlp_device_info *wdi;
void (*fill_device_info)(struct wlp *wlp, struct wlp_device_info *info);
int (*xmit_frame)(struct wlp *, struct sk_buff *,
struct uwb_dev_addr *);