wireless: ath6kl: re-use native helper to parse MAC
There is native mac_pton() function which helps to parse MAC. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
ab1ef14116
commit
ade9833074
1 changed files with 1 additions and 7 deletions
|
@ -1240,20 +1240,14 @@ static ssize_t ath6kl_force_roam_write(struct file *file,
|
||||||
char buf[20];
|
char buf[20];
|
||||||
size_t len;
|
size_t len;
|
||||||
u8 bssid[ETH_ALEN];
|
u8 bssid[ETH_ALEN];
|
||||||
int i;
|
|
||||||
int addr[ETH_ALEN];
|
|
||||||
|
|
||||||
len = min(count, sizeof(buf) - 1);
|
len = min(count, sizeof(buf) - 1);
|
||||||
if (copy_from_user(buf, user_buf, len))
|
if (copy_from_user(buf, user_buf, len))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
|
|
||||||
if (sscanf(buf, "%02x:%02x:%02x:%02x:%02x:%02x",
|
if (!mac_pton(buf, bssid))
|
||||||
&addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
|
|
||||||
!= ETH_ALEN)
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
for (i = 0; i < ETH_ALEN; i++)
|
|
||||||
bssid[i] = addr[i];
|
|
||||||
|
|
||||||
ret = ath6kl_wmi_force_roam_cmd(ar->wmi, bssid);
|
ret = ath6kl_wmi_force_roam_cmd(ar->wmi, bssid);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Add table
Reference in a new issue