s32 dhd_config_dongle(struct wl_priv *wl, bool need_lock) { #ifndef DHD_SDALIGN #define DHD_SDALIGN 32 #endif struct net_device *ndev; s32 err = 0; WL_TRACE(("In\n")); if (dhd_dongle_up) { WL_ERR(("Dongle is already up\n")); return err; } ndev = wl_to_prmry_ndev(wl); if (need_lock) rtnl_lock(); err = wl_dongle_up(ndev, 0); if (unlikely(err)) { WL_ERR(("wl_dongle_up failed\n")); goto default_conf_out; } dhd_dongle_up = true; default_conf_out: if (need_lock) rtnl_unlock(); return err; }
s32 dhd_config_dongle(struct bcm_cfg80211 *cfg) { #ifndef DHD_SDALIGN #define DHD_SDALIGN 32 #endif struct net_device *ndev; s32 err = 0; WL_TRACE(("In\n")); if (dhd_dongle_up) { WL_ERR(("Dongle is already up\n")); return err; } ndev = bcmcfg_to_prmry_ndev(cfg); err = wl_dongle_up(ndev); if (unlikely(err)) { WL_ERR(("wl_dongle_up failed\n")); goto default_conf_out; } dhd_dongle_up = true; default_conf_out: return err; }
/* set mode to allow pattern */ bcm_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf, sizeof(iovbuf)); err = wldev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf), true); if (err) { if (err == -EOPNOTSUPP) { WL_INFO(("filter_mode not supported\n")); } else { WL_ERR(("filter_mode (%d)\n", err)); } goto dongle_filter_out; } dongle_filter_out: return err; } #endif /* OEM_ANDROID */ s32 dhd_config_dongle(struct wl_priv *wl, bool need_lock) { #ifndef DHD_SDALIGN #define DHD_SDALIGN 32 #endif struct net_device *ndev; s32 err = 0; WL_TRACE(("In\n")); if (dhd_dongle_up) { WL_ERR(("Dongle is already up\n")); return err; } ndev = wl_to_prmry_ndev(wl); if (need_lock) rtnl_lock(); err = wl_dongle_up(ndev, 0); if (unlikely(err)) { WL_ERR(("wl_dongle_up failed\n")); goto default_conf_out; } #ifndef OEM_ANDROID err = wl_dongle_power(ndev, PM_FAST); if (unlikely(err)) { WL_ERR(("wl_dongle_power failed\n")); goto default_conf_out; } err = wl_dongle_glom(ndev, 0, DHD_SDALIGN); if (unlikely(err)) { WL_ERR(("wl_dongle_glom failed\n")); goto default_conf_out; } err = wl_dongle_roam(ndev, (wl->roam_on ? 0 : 1), 3); if (unlikely(err)) { WL_ERR(("wl_dongle_roam failed\n")); goto default_conf_out; } wl_dongle_scantime(ndev, 40, 80); wl_dongle_offload(ndev, 1, 0xf); wl_dongle_filter(ndev, 1); #endif /* OEM_ANDROID */ dhd_dongle_up = true; default_conf_out: if (need_lock) rtnl_unlock(); return err; }