* @nmi_addr: NAN Management Interface (NMI) address
* @reserved_for_nmi_addr: reserved
* @discovery_beacon_interval: discovery beacon interval in TUs
- * @cluster_id: local cluster ID, in case the local device starts a cluster
+ * @cluster_id: lower last two bytes of the cluster ID, in case the local
+ * device starts a cluster
* @sta_id: station ID of the NAN station
* @hb_channel: channel for 5 GHz if the device supports operation on 5 GHz.
* Valid values are 44 and 149, which correspond to the 5 GHz channel, and
__le16 reserved_for_nmi_addr;
__le32 discovery_beacon_interval;
- __le16 cluster_id;
+ u8 cluster_id[2];
u8 sta_id;
u8 hb_channel;
* struct iwl_nan_cluster_notif - event sent when the device starts or joins a
* NAN cluster.
*
- * @cluster_id: cluster ID
+ * @cluster_id: the last two bytes of the cluster ID
* @flags: combination of &enum iwl_nan_cluster_notif_flags
* @reserved: reserved
*/
struct iwl_nan_cluster_notif {
- __le16 cluster_id;
+ u8 cluster_id[2];
u8 flags;
u8 reserved;
}; /* NAN_JOINED_CLUSTER_NTF_API_S_VER_1 */
cmd.master_pref = conf->master_pref;
if (conf->cluster_id)
- cmd.cluster_id =
- cpu_to_le16(*(const u16 *)(conf->cluster_id + 4));
+ memcpy(cmd.cluster_id, conf->cluster_id + 4,
+ sizeof(cmd.cluster_id));
cmd.scan_period = conf->scan_period < 255 ? conf->scan_period : 255;
cmd.dwell_time =
ieee80211_vif_to_wdev(mld->nan_device_vif) : NULL;
bool new_cluster = !!(notif->flags &
IWL_NAN_CLUSTER_NOTIF_FLAG_NEW_CLUSTER);
- u8 cluster_id[ETH_ALEN] __aligned(2) = {
- 0x50, 0x6f, 0x9a, 0x01, 0x00, 0x00
+ u8 cluster_id[ETH_ALEN] = {
+ 0x50, 0x6f, 0x9a, 0x01,
+ notif->cluster_id[0], notif->cluster_id[1]
};
- u16 id = le16_to_cpu(notif->cluster_id);
IWL_DEBUG_INFO(mld,
- "NAN: cluster event: cluster_id=0x%x, flags=0x%x\n",
- id, notif->flags);
+ "NAN: cluster event: cluster_id=%pM, flags=0x%x\n",
+ cluster_id, notif->flags);
if (IWL_FW_CHECK(mld, !wdev, "NAN: cluster event without wdev\n"))
return;
"NAN: cluster event without NAN started\n"))
return;
- *((u16 *)(cluster_id + 4)) = id;
-
cfg80211_nan_cluster_joined(wdev, cluster_id, new_cluster, GFP_KERNEL);
}