Commit ac24be6f authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: use struct brcmf_if as interface object for fwil functions

The functions for communicating were given the net_device only because
its private data contained struct brcmf_if object. However, not all
firmware related interfaces will be associated with a net_device. To
accomodate provisioning firmware for such interfaces the struct
brcmf_if object will be passed to the fwil functions.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6e186166
...@@ -57,9 +57,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) ...@@ -57,9 +57,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
} }
s32 s32
brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, u32 len) brcmf_fil_cmd_data_set(struct brcmf_if *ifp, u32 cmd, void *data, u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err; s32 err;
mutex_lock(&ifp->drvr->proto_block); mutex_lock(&ifp->drvr->proto_block);
...@@ -74,9 +73,8 @@ brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, u32 len) ...@@ -74,9 +73,8 @@ brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, u32 len)
} }
s32 s32
brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, u32 len) brcmf_fil_cmd_data_get(struct brcmf_if *ifp, u32 cmd, void *data, u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err; s32 err;
mutex_lock(&ifp->drvr->proto_block); mutex_lock(&ifp->drvr->proto_block);
...@@ -92,9 +90,8 @@ brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, u32 len) ...@@ -92,9 +90,8 @@ brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, u32 len)
s32 s32
brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data) brcmf_fil_cmd_int_set(struct brcmf_if *ifp, u32 cmd, u32 data)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err; s32 err;
__le32 data_le = cpu_to_le32(data); __le32 data_le = cpu_to_le32(data);
...@@ -106,9 +103,8 @@ brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data) ...@@ -106,9 +103,8 @@ brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data)
} }
s32 s32
brcmf_fil_cmd_int_get(struct net_device *ndev, u32 cmd, u32 *data) brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err; s32 err;
__le32 data_le = cpu_to_le32(*data); __le32 data_le = cpu_to_le32(*data);
...@@ -141,10 +137,9 @@ brcmf_create_iovar(char *name, char *data, u32 datalen, char *buf, u32 buflen) ...@@ -141,10 +137,9 @@ brcmf_create_iovar(char *name, char *data, u32 datalen, char *buf, u32 buflen)
s32 s32
brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data,
u32 len) u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
s32 err; s32 err;
u32 buflen; u32 buflen;
...@@ -169,10 +164,9 @@ brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, ...@@ -169,10 +164,9 @@ brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data,
} }
s32 s32
brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data,
u32 len) u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
s32 err; s32 err;
u32 buflen; u32 buflen;
...@@ -199,20 +193,20 @@ brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, ...@@ -199,20 +193,20 @@ brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data,
} }
s32 s32
brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data) brcmf_fil_iovar_int_set(struct brcmf_if *ifp, char *name, u32 data)
{ {
__le32 data_le = cpu_to_le32(data); __le32 data_le = cpu_to_le32(data);
return brcmf_fil_iovar_data_set(ndev, name, &data_le, sizeof(data_le)); return brcmf_fil_iovar_data_set(ifp, name, &data_le, sizeof(data_le));
} }
s32 s32
brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data) brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data)
{ {
__le32 data_le = cpu_to_le32(*data); __le32 data_le = cpu_to_le32(*data);
s32 err; s32 err;
err = brcmf_fil_iovar_data_get(ndev, name, &data_le, sizeof(data_le)); err = brcmf_fil_iovar_data_get(ifp, name, &data_le, sizeof(data_le));
if (err == 0) if (err == 0)
*data = le32_to_cpu(data_le); *data = le32_to_cpu(data_le);
return err; return err;
...@@ -264,10 +258,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, ...@@ -264,10 +258,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf,
} }
s32 s32
brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name,
void *data, u32 len) void *data, u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
s32 err; s32 err;
u32 buflen; u32 buflen;
...@@ -292,10 +285,9 @@ brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, ...@@ -292,10 +285,9 @@ brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name,
} }
s32 s32
brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
void *data, u32 len) void *data, u32 len)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
s32 err; s32 err;
u32 buflen; u32 buflen;
...@@ -322,21 +314,21 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, ...@@ -322,21 +314,21 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name,
} }
s32 s32
brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data) brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, char *name, u32 data)
{ {
__le32 data_le = cpu_to_le32(data); __le32 data_le = cpu_to_le32(data);
return brcmf_fil_bsscfg_data_set(ndev, name, &data_le, return brcmf_fil_bsscfg_data_set(ifp, name, &data_le,
sizeof(data_le)); sizeof(data_le));
} }
s32 s32
brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data) brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, char *name, u32 *data)
{ {
__le32 data_le = cpu_to_le32(*data); __le32 data_le = cpu_to_le32(*data);
s32 err; s32 err;
err = brcmf_fil_bsscfg_data_get(ndev, name, &data_le, err = brcmf_fil_bsscfg_data_get(ifp, name, &data_le,
sizeof(data_le)); sizeof(data_le));
if (err == 0) if (err == 0)
*data = le32_to_cpu(data_le); *data = le32_to_cpu(data_le);
......
...@@ -17,25 +17,23 @@ ...@@ -17,25 +17,23 @@
#ifndef _fwil_h_ #ifndef _fwil_h_
#define _fwil_h_ #define _fwil_h_
s32 brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, s32 brcmf_fil_cmd_data_set(struct brcmf_if *ifp, u32 cmd, void *data, u32 len);
u32 len); s32 brcmf_fil_cmd_data_get(struct brcmf_if *ifp, u32 cmd, void *data, u32 len);
s32 brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, s32 brcmf_fil_cmd_int_set(struct brcmf_if *ifp, u32 cmd, u32 data);
u32 len); s32 brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data);
s32 brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data);
s32 brcmf_fil_cmd_int_get(struct net_device *ndev, u32 cmd, u32 *data);
s32 brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, s32 brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data,
u32 len); u32 len);
s32 brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, s32 brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data,
u32 len); u32 len);
s32 brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data); s32 brcmf_fil_iovar_int_set(struct brcmf_if *ifp, char *name, u32 data);
s32 brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data); s32 brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data);
s32 brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, void *data, s32 brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name, void *data,
u32 len); u32 len);
s32 brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, void *data, s32 brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, void *data,
u32 len); u32 len);
s32 brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data); s32 brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, char *name, u32 data);
s32 brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data); s32 brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, char *name, u32 *data);
#endif /* _fwil_h_ */ #endif /* _fwil_h_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment