Commit a84bac46 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: rename fullmac functions



The function provided by dhd_linux.c have been renamed to make
the naming throughout the driver more consistent and remove
Broadcom specific acronyms which are not meaningful.

Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 15cf23d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ int brcmf_sdio_probe(struct device *dev)
#else
	irq_flags = IRQF_TRIGGER_FALLING;
#endif				/* HW_OOB */
	irq = dhd_customer_oob_irq_map(&irq_flags);
	irq = brcmf_customer_oob_irq_map(&irq_flags);
	if (irq < 0) {
		SDLX_MSG(("%s: Host irq is not defined\n", __func__));
		return 1;
+45 −43
Original line number Diff line number Diff line
@@ -881,96 +881,98 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
 * Returned structure should have bus and prot pointers filled in.
 * bus_hdrlen specifies required headroom for bus module header.
 */
extern dhd_pub_t *dhd_attach(struct dhd_bus *bus,
extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
				uint bus_hdrlen);
extern int dhd_net_attach(dhd_pub_t *dhdp, int idx);
extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);

/* Indication from bus module regarding removal/absence of dongle */
extern void dhd_detach(dhd_pub_t *dhdp);
extern void brcmf_detach(dhd_pub_t *dhdp);

/* Indication from bus module to change flow-control state */
extern void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
extern void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);

extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
			 struct sk_buff *pkt, int prec);

/* Receive frame for delivery to OS.  Callee disposes of rxp. */
extern void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx,
extern void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx,
			 struct sk_buff *rxp, int numpkt);

/* Return pointer to interface name */
extern char *dhd_ifname(dhd_pub_t *dhdp, int idx);
extern char *brcmf_ifname(dhd_pub_t *dhdp, int idx);

/* Request scheduling of the bus dpc */
extern void dhd_sched_dpc(dhd_pub_t *dhdp);
extern void brcmf_sched_dpc(dhd_pub_t *dhdp);

/* Notify tx completion */
extern void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success);
extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
			     bool success);

/* Query ioctl */
extern int dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
			      uint len);

/* OS independent layer functions */
extern int dhd_os_proto_block(dhd_pub_t *pub);
extern int dhd_os_proto_unblock(dhd_pub_t *pub);
extern int dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
extern int brcmf_os_proto_block(dhd_pub_t *pub);
extern int brcmf_os_proto_unblock(dhd_pub_t *pub);
extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
				  bool *pending);
extern int dhd_os_ioctl_resp_wake(dhd_pub_t *pub);
extern unsigned int dhd_os_get_ioctl_resp_timeout(void);
extern void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void *dhd_os_open_image(char *filename);
extern int dhd_os_get_image_block(char *buf, int len, void *image);
extern void dhd_os_close_image(void *image);
extern void dhd_os_wd_timer(void *bus, uint wdtick);
extern void dhd_os_sdlock(dhd_pub_t *pub);
extern void dhd_os_sdunlock(dhd_pub_t *pub);
extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void dhd_customer_gpio_wlan_ctrl(int onoff);
extern int dhd_custom_get_mac_address(unsigned char *buf);
extern void dhd_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
extern void dhd_os_sdlock_eventq(dhd_pub_t *pub);
extern void dhd_os_sdunlock_eventq(dhd_pub_t *pub);
extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void *brcmf_os_open_image(char *filename);
extern int brcmf_os_get_image_block(char *buf, int len, void *image);
extern void brcmf_os_close_image(void *image);
extern void brcmf_os_wd_timer(void *bus, uint wdtick);
extern void brcmf_os_sdlock(dhd_pub_t *pub);
extern void brcmf_os_sdunlock(dhd_pub_t *pub);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
#ifdef DHD_DEBUG
extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif				/* DHD_DEBUG */
#if defined(OOB_INTR_ONLY)
extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif				/* defined(OOB_INTR_ONLY) */

extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int dhd_timeout_expired(dhd_timeout_t *tmo);
extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int brcmf_timeout_expired(dhd_timeout_t *tmo);

extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
			 brcmf_event_msg_t *, void **data_ptr);

extern void brcmf_c_init(void);

extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
extern int brcmf_add_if(struct dhd_info *dhd, int ifidx, void *handle,
		      char *name, u8 *mac_addr, u32 flags, u8 bssidx);
extern void dhd_del_if(struct dhd_info *dhd, int ifidx);
extern void brcmf_del_if(struct dhd_info *dhd, int ifidx);

extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char *name);
extern void dhd_vif_del(struct dhd_info *dhd, int ifidx);
extern void brcmf_vif_add(struct dhd_info *dhd, int ifidx, char *name);
extern void brcmf_vif_del(struct dhd_info *dhd, int ifidx);

extern void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx);
extern void dhd_vif_sendup(struct dhd_info *dhd, int ifidx, unsigned char * cp,
			   int len);
extern void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen,
			int ifidx);
extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
			     unsigned char *cp, int len);

/* Send packet to dongle via data channel */
extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);

/* Send event to host */
extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
			     void *data);
extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern uint dhd_bus_status(dhd_pub_t *dhdp);
extern int dhd_bus_start(dhd_pub_t *dhdp);
extern int brcmf_bus_start(dhd_pub_t *dhdp);

extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
extern void brcmf_wait_event_wakeup(dhd_pub_t *dhd);

#ifdef PKT_FILTER_SUPPORT
extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
+11 −9
Original line number Diff line number Diff line
@@ -204,7 +204,8 @@ retry:
		goto retry;
	if (id != prot->reqid) {
		DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
			   dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
			   brcmf_ifname(dhd, ifidx), __func__, id,
			   prot->reqid));
		ret = -EINVAL;
		goto done;
	}
@@ -264,7 +265,8 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

	if (id != prot->reqid) {
		DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
			   dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
			   brcmf_ifname(dhd, ifidx), __func__, id,
			   prot->reqid));
		ret = -EINVAL;
		goto done;
	}
@@ -292,7 +294,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
			   __func__));
		return ret;
	}
	dhd_os_proto_block(dhd);
	brcmf_os_proto_block(dhd);

	DHD_TRACE(("%s: Enter\n", __func__));

@@ -346,7 +348,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
	prot->pending = false;

done:
	dhd_os_proto_unblock(dhd);
	brcmf_os_proto_unblock(dhd);

	return ret;
}
@@ -427,14 +429,14 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
	if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) !=
	    BDC_PROTO_VER) {
		DHD_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
			   dhd_ifname(dhd, *ifidx), h->flags));
			   brcmf_ifname(dhd, *ifidx), h->flags));
		return -EBADE;
	}

	if (h->flags & BDC_FLAG_SUM_GOOD) {
		DHD_INFO(("%s: BDC packet received with good rx-csum, "
			"flags 0x%x\n",
			dhd_ifname(dhd, *ifidx), h->flags));
			brcmf_ifname(dhd, *ifidx), h->flags));
		PKTSETSUMGOOD(pktbuf, true);
	}

@@ -501,18 +503,18 @@ int dhd_prot_init(dhd_pub_t *dhd)

	DHD_TRACE(("%s: Enter\n", __func__));

	dhd_os_proto_block(dhd);
	brcmf_os_proto_block(dhd);

	/* Get the device MAC address */
	strcpy(buf, "cur_etheraddr");
	ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
	if (ret < 0) {
		dhd_os_proto_unblock(dhd);
		brcmf_os_proto_unblock(dhd);
		return ret;
	}
	memcpy(dhd->mac, buf, ETH_ALEN);

	dhd_os_proto_unblock(dhd);
	brcmf_os_proto_unblock(dhd);

#ifdef EMBEDDED_PLATFORM
	ret = brcmf_c_preinit_ioctls(dhd);
+12 −12
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
			bcmerror = -ENOLINK;
			break;
		}
		dhd_os_wd_timer(dhd_pub, (uint) int_val);
		brcmf_os_wd_timer(dhd_pub, (uint) int_val);
		break;

	case IOV_GVAL(IOV_DUMP):
@@ -300,7 +300,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
		break;

	case IOV_GVAL(IOV_IOCTLTIMEOUT):{
			int_val = (s32) dhd_os_get_ioctl_resp_timeout();
			int_val = (s32) brcmf_os_get_ioctl_resp_timeout();
			memcpy(arg, &int_val, sizeof(int_val));
			break;
		}
@@ -309,7 +309,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
			if (int_val <= 0)
				bcmerror = -EINVAL;
			else
				dhd_os_set_ioctl_resp_timeout((unsigned int)
				brcmf_os_set_ioctl_resp_timeout((unsigned int)
							      int_val);
			break;
		}
@@ -865,13 +865,13 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
			if (ifevent->ifidx > 0 &&
				 ifevent->ifidx < DHD_MAX_IFS) {
				if (ifevent->action == BRCMF_E_IF_ADD)
					dhd_add_if(dhd, ifevent->ifidx,
					brcmf_add_if(dhd, ifevent->ifidx,
						   NULL, event->ifname,
						   pvt_data->eth.h_dest,
						   ifevent->flags,
						   ifevent->bssidx);
				else
					dhd_del_if(dhd, ifevent->ifidx);
					brcmf_del_if(dhd, ifevent->ifidx);
			} else {
				DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
					   __func__, ifevent->ifidx,
@@ -879,9 +879,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
			}
		}
		/* send up the if event: btamp user needs it */
		*ifidx = dhd_ifname2idx(dhd, event->ifname);
		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
		/* push up to external supp/auth */
		dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
		break;

#ifdef P2P
@@ -898,9 +898,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
	default:
		/* Fall through: this should get _everything_  */

		*ifidx = dhd_ifname2idx(dhd, event->ifname);
		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
		/* push up to external supp/auth */
		dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
		DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
			   __func__, type, flags, status));

@@ -1207,7 +1207,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
	u8 ea_addr[ETH_ALEN];
#endif				/* GET_CUSTOM_MAC_ENABLE */

	dhd_os_proto_block(dhd);
	brcmf_os_proto_block(dhd);

#ifdef GET_CUSTOM_MAC_ENABLE
	/* Read MAC address from external customer place
@@ -1216,7 +1216,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
	 ** firmware but unique per board mac address maybe provided by
	 ** customer code
	 */
	ret = dhd_custom_get_mac_address(ea_addr);
	ret = brcmf_custom_get_mac_address(ea_addr);
	if (!ret) {
		brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
			    buf, sizeof(buf));
@@ -1313,7 +1313,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
	}
#endif				/* PKT_FILTER_SUPPORT */

	dhd_os_proto_unblock(dhd);
	brcmf_os_proto_unblock(dhd);

	return 0;
}
+3 −3
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static int dhd_oob_gpio_num = -1; /* GG 19 */
module_param(dhd_oob_gpio_num, int, 0644);
MODULE_PARM_DESC(dhd_oob_gpio_num, "DHD oob gpio number");

int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr)
{
	int host_oob_irq = 0;

@@ -88,7 +88,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
#endif				/* defined(OOB_INTR_ONLY) */

/* Customer function to control hw specific wlan gpios */
void dhd_customer_gpio_wlan_ctrl(int onoff)
void brcmf_customer_gpio_wlan_ctrl(int onoff)
{
	switch (onoff) {
	case WLAN_RESET_OFF:
@@ -137,7 +137,7 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)

#ifdef GET_CUSTOM_MAC_ENABLE
/* Function to get custom MAC address */
int dhd_custom_get_mac_address(unsigned char *buf)
int brcmf_custom_get_mac_address(unsigned char *buf)
{
	WL_TRACE("%s Enter\n", __func__);
	if (!buf)
Loading