qcacld-3.0: Update data type of iface name to const for NAN
Currently driver code has data type as char* for NAN related code. With this change update this data type as const char*. Also, move NAN related functions under WLAN_FEATURE_NAN feature flag. Change-ID: I61ad10304be4399a68f32778d01d9a951d7d14bb CRs-Fixed: 3169168
这个提交包含在:
@@ -804,9 +804,9 @@ struct nan_callbacks {
|
||||
uint32_t type, void *msg);
|
||||
void (*ucfg_nan_request_process_cb)(void *cookie);
|
||||
int (*ndi_open)(const char *iface_name, bool is_add_virtual_iface);
|
||||
int (*ndi_start)(char *iface_name, uint16_t);
|
||||
int (*ndi_start)(const char *iface_name, uint16_t);
|
||||
void (*ndi_close)(uint8_t);
|
||||
int (*ndi_delete)(uint8_t, char *iface_name, uint16_t transaction_id);
|
||||
int (*ndi_delete)(uint8_t, const char *iface_name, uint16_t transaction_id);
|
||||
void (*drv_ndi_create_rsp_handler)
|
||||
(uint8_t, struct nan_datapath_inf_create_rsp *);
|
||||
void (*drv_ndi_delete_rsp_handler)(uint8_t);
|
||||
|
@@ -734,7 +734,7 @@ int hdd_ndi_open(const char *iface_name, bool is_add_virtual_iface)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hdd_ndi_start(char *iface_name, uint16_t transaction_id)
|
||||
int hdd_ndi_start(const char *iface_name, uint16_t transaction_id)
|
||||
{
|
||||
int ret;
|
||||
QDF_STATUS status;
|
||||
@@ -832,7 +832,8 @@ static int hdd_delete_ndi_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
|
||||
}
|
||||
#endif
|
||||
|
||||
int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id)
|
||||
int hdd_ndi_delete(uint8_t vdev_id, const char *iface_name,
|
||||
uint16_t transaction_id)
|
||||
{
|
||||
int ret;
|
||||
struct hdd_adapter *adapter;
|
||||
@@ -1021,15 +1022,6 @@ void hdd_ndp_session_end_handler(struct hdd_adapter *adapter)
|
||||
hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_NAN_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_ndp_new_peer_handler() - NDP new peer indication handler
|
||||
* @vdev_id: vdev id
|
||||
* @sta_id: station id
|
||||
* @peer_mac_addr: peer mac address
|
||||
* @first_peer: first peer
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr, bool first_peer)
|
||||
{
|
||||
@@ -1131,13 +1123,6 @@ void hdd_cleanup_ndi(struct hdd_context *hdd_ctx,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_ndp_peer_departed_handler() - Handle NDP peer departed indication
|
||||
* @adapter: pointer to adapter context
|
||||
* @ind_params: indication parameters
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr, bool last_peer)
|
||||
{
|
||||
|
@@ -82,7 +82,7 @@ void hdd_cleanup_ndi(struct hdd_context *hdd_ctx,
|
||||
*
|
||||
* Return: 0 upon success
|
||||
*/
|
||||
int hdd_ndi_start(char *iface_name, uint16_t transaction_id);
|
||||
int hdd_ndi_start(const char *iface_name, uint16_t transaction_id);
|
||||
|
||||
/**
|
||||
* hdd_add_ndi_intf(): Add NDI interface
|
||||
@@ -94,6 +94,82 @@ int hdd_ndi_start(char *iface_name, uint16_t transaction_id);
|
||||
struct wireless_dev *hdd_add_ndi_intf(struct hdd_context *hdd_ctx,
|
||||
const char *name);
|
||||
|
||||
enum nan_datapath_state;
|
||||
struct nan_datapath_inf_create_rsp;
|
||||
|
||||
/**
|
||||
* hdd_ndi_open(): Open NDI interface
|
||||
* @iface_name: NDI interface name
|
||||
* @is_add_virtual_iface: is this interface getting created through add virtual
|
||||
* interface
|
||||
*
|
||||
* Return: 0 on success, error code on failure
|
||||
*/
|
||||
int hdd_ndi_open(const char *iface_name, bool is_add_virtual_iface);
|
||||
|
||||
/**
|
||||
* hdd_ndi_delete(): Delete NDI interface
|
||||
* @vdev_id: vdev id of the NDI interface
|
||||
* @iface_name: NDI interface name
|
||||
* @transaction_id: Transaction id
|
||||
*
|
||||
* Return: 0 on success, error code on failure
|
||||
*/
|
||||
int hdd_ndi_delete(uint8_t vdev_id, const char *iface_name,
|
||||
uint16_t transaction_id);
|
||||
|
||||
/**
|
||||
* hdd_ndi_close(): Close NDI interface
|
||||
* @vdev_id: vdev id of the NDI interface
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void hdd_ndi_close(uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* hdd_ndi_drv_ndi_create_rsp_handler(): ndi create response handler
|
||||
* @vdev_id: vdev id of the NDI interface
|
||||
* @ndi_rsp: NDI create response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
|
||||
struct nan_datapath_inf_create_rsp *ndi_rsp);
|
||||
|
||||
/**
|
||||
* hdd_ndi_drv_ndi_create_rsp_handler(): ndi delete response handler
|
||||
* @vdev_id: vdev id of the NDI interface
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* hdd_ndp_new_peer_handler(): NDP new peer indication handler
|
||||
* @vdev_id: vdev id
|
||||
* @sta_id: STA ID
|
||||
* @peer_mac_addr: MAC address of the peer
|
||||
* @first_peer: Indicates if it is first peer
|
||||
*
|
||||
* Return: 0 on success, error code on failure
|
||||
*/
|
||||
int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr,
|
||||
bool first_peer);
|
||||
|
||||
/**
|
||||
* hdd_ndp_peer_departed_handler(): Handle NDP peer departed indication
|
||||
* @vdev_id: vdev id
|
||||
* @sta_id: STA ID
|
||||
* @peer_mac_addr: MAC address of the peer
|
||||
* @first_peer: Indicates if it is last peer
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr,
|
||||
bool last_peer);
|
||||
|
||||
#else
|
||||
#define WLAN_HDD_IS_NDI(adapter) (false)
|
||||
#define WLAN_HDD_IS_NDI_CONNECTED(adapter) (false)
|
||||
@@ -126,23 +202,59 @@ static inline void hdd_cleanup_ndi(struct hdd_context *hdd_ctx,
|
||||
{
|
||||
}
|
||||
|
||||
static inline int hdd_ndi_start(char *iface_name, uint16_t transaction_id)
|
||||
static inline int hdd_ndi_start(const char *iface_name, uint16_t transaction_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
|
||||
static inline struct wireless_dev *hdd_add_ndi_intf(struct hdd_context *hdd_ctx,
|
||||
const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum nan_datapath_state;
|
||||
struct nan_datapath_inf_create_rsp;
|
||||
|
||||
int hdd_ndi_open(const char *iface_name, bool is_add_virtual_iface);
|
||||
int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id);
|
||||
void hdd_ndi_close(uint8_t vdev_id);
|
||||
void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
|
||||
struct nan_datapath_inf_create_rsp *ndi_rsp);
|
||||
void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id);
|
||||
int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr, bool first_peer);
|
||||
void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr, bool last_peer);
|
||||
static inline int
|
||||
hdd_ndi_open(const char *iface_name, bool is_add_virtual_iface)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
hdd_ndi_delete(uint8_t vdev_id, const char *iface_name, uint16_t transaction_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hdd_ndi_close(uint8_t vdev_id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
|
||||
struct nan_datapath_inf_create_rsp *ndi_rsp)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr,
|
||||
bool first_peer)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hdd_ndp_peer_departed_handler(uint8_t vdev_id,
|
||||
uint16_t sta_id,
|
||||
struct qdf_mac_addr *peer_mac_addr,
|
||||
bool last_peer)
|
||||
{
|
||||
}
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
|
||||
#endif /* __WLAN_HDD_NAN_DATAPATH_H */
|
||||
|
@@ -44,7 +44,7 @@ extern const struct nla_policy vendor_attr_policy[
|
||||
* @found_vdev: found vdev object matching one or more of above params
|
||||
*/
|
||||
struct ndi_find_vdev_filter {
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
struct wlan_objmgr_vdev *found_vdev;
|
||||
};
|
||||
|
||||
|
@@ -220,7 +220,7 @@ static void os_if_get_ndi_vdev_by_ifname_cb(struct wlan_objmgr_psoc *psoc,
|
||||
* Return : vdev object if found, NULL otherwise
|
||||
*/
|
||||
static struct wlan_objmgr_vdev *
|
||||
os_if_get_ndi_vdev_by_ifname(struct wlan_objmgr_psoc *psoc, char *ifname)
|
||||
os_if_get_ndi_vdev_by_ifname(struct wlan_objmgr_psoc *psoc, const char *ifname)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct ndi_find_vdev_filter filter = {0};
|
||||
@@ -299,7 +299,7 @@ static int os_if_nan_ndi_open(struct wlan_objmgr_psoc *psoc,
|
||||
#endif
|
||||
|
||||
static int __os_if_nan_process_ndi_create(struct wlan_objmgr_psoc *psoc,
|
||||
char *iface_name,
|
||||
const char *iface_name,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
int ret;
|
||||
@@ -339,7 +339,7 @@ static int __os_if_nan_process_ndi_create(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
|
||||
static int
|
||||
osif_nla_str(struct nlattr **tb, size_t attr_id, char **out_str)
|
||||
osif_nla_str(struct nlattr **tb, size_t attr_id, const char **out_str)
|
||||
{
|
||||
if (!tb || !tb[attr_id])
|
||||
return -EINVAL;
|
||||
@@ -367,7 +367,7 @@ static int osif_net_dev_from_vdev(struct wlan_objmgr_vdev *vdev,
|
||||
}
|
||||
|
||||
static int osif_net_dev_from_ifname(struct wlan_objmgr_psoc *psoc,
|
||||
char *iface_name,
|
||||
const char *iface_name,
|
||||
struct net_device **out_net_dev)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
@@ -396,7 +396,7 @@ static int os_if_nan_process_ndi_create(struct wlan_objmgr_psoc *psoc,
|
||||
struct wireless_dev *wdev)
|
||||
{
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
int errno;
|
||||
|
||||
osif_debug("enter");
|
||||
@@ -447,7 +447,7 @@ static int os_if_nan_process_ndi_create(struct wlan_objmgr_psoc *psoc,
|
||||
struct device *dev;
|
||||
struct net_device *net_dev;
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
int errno;
|
||||
|
||||
osif_debug("enter");
|
||||
@@ -486,7 +486,7 @@ destroy_sync:
|
||||
#endif
|
||||
|
||||
static int __os_if_nan_process_ndi_delete(struct wlan_objmgr_psoc *psoc,
|
||||
char *iface_name,
|
||||
const char *iface_name,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
@@ -537,7 +537,7 @@ static int os_if_nan_process_ndi_delete(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
struct net_device *net_dev;
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
int errno;
|
||||
|
||||
osif_debug("enter");
|
||||
@@ -573,7 +573,7 @@ static int os_if_nan_process_ndi_delete(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
struct net_device *net_dev;
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
int errno;
|
||||
|
||||
osif_debug("enter");
|
||||
@@ -697,7 +697,7 @@ static int os_if_nan_parse_security_params(struct nlattr **tb,
|
||||
* Return: 0 on success or error code on failure
|
||||
*/
|
||||
static int __os_if_nan_process_ndp_initiator_req(struct wlan_objmgr_psoc *psoc,
|
||||
char *iface_name,
|
||||
const char *iface_name,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -821,7 +821,7 @@ static int os_if_nan_process_ndp_initiator_req(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
struct net_device *net_dev;
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
char *ifname;
|
||||
const char *ifname;
|
||||
int errno;
|
||||
|
||||
errno = osif_nla_str(tb, QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR, &ifname);
|
||||
@@ -870,7 +870,7 @@ static int __os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
|
||||
enum nan_datapath_state state;
|
||||
struct wlan_objmgr_vdev *nan_vdev = NULL;
|
||||
struct nan_datapath_responder_req req = {0};
|
||||
char *iface_name;
|
||||
const char *iface_name;
|
||||
int errno;
|
||||
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]) {
|
||||
|
在新工单中引用
屏蔽一个用户