return ret;
 }
 
-int wl1271_cmd_join(struct wl1271 *wl)
+int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
 {
        static bool do_cal = true;
        struct wl1271_cmd_join *join;
 
        join->rx_config_options = cpu_to_le32(wl->rx_config);
        join->rx_filter_options = cpu_to_le32(wl->rx_filter);
-       join->bss_type = wl->bss_type;
+       join->bss_type = bss_type;
 
        /*
         * FIXME: disable temporarily all filters because after commit
 
                    size_t res_len);
 int wl1271_cmd_general_parms(struct wl1271 *wl);
 int wl1271_cmd_radio_parms(struct wl1271 *wl);
-int wl1271_cmd_join(struct wl1271 *wl);
+int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type);
 int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
 int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
 int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
 
 
                memcpy(wl->bssid, conf->bssid, ETH_ALEN);
 
-               ret = wl1271_cmd_join(wl);
+               ret = wl1271_cmd_join(wl, wl->bss_type);
                if (ret < 0)
                        goto out_sleep;
 
        static const u8 dummy_bssid[ETH_ALEN] = { 0x0b, 0xad, 0xde,
                                                  0xad, 0xbe, 0xef };
 
-       /* the dummy join is not required for ad-hoc */
-       if (wl->bss_type == BSS_TYPE_IBSS)
-               goto out;
-
        /* disable mac filter, so we hear everything */
        wl->rx_config &= ~CFG_BSSID_FILTER_EN;
 
        wl->channel = channel;
        memcpy(wl->bssid, dummy_bssid, ETH_ALEN);
 
-       ret = wl1271_cmd_join(wl);
+       /* the dummy join is performed always with STATION BSS type to allow
+          also ad-hoc mode to listen to the surroundings without sending any
+          beacons yet. */
+       ret = wl1271_cmd_join(wl, BSS_TYPE_STA_BSS);
        if (ret < 0)
                goto out;
 
            test_bit(WL1271_FLAG_JOINED, &wl->flags)) {
                wl->channel = channel;
                /* FIXME: maybe use CMD_CHANNEL_SWITCH for this? */
-               ret = wl1271_cmd_join(wl);
+               ret = wl1271_cmd_join(wl, wl->bss_type);
                if (ret < 0)
                        wl1271_warning("cmd join to update channel failed %d",
                                       ret);
        }
 
        if (do_join) {
-               ret = wl1271_cmd_join(wl);
+               ret = wl1271_cmd_join(wl, wl->bss_type);
                if (ret < 0) {
                        wl1271_warning("cmd join failed %d", ret);
                        goto out_sleep;