Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2016 06:29:24 +0000 (UTC)
From:      Stanislav Galabov <sgalabov@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300657 - head/sys/dev/ral
Message-ID:  <201605250629.u4P6TOQ6006434@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sgalabov
Date: Wed May 25 06:29:23 2016
New Revision: 300657
URL: https://svnweb.freebsd.org/changeset/base/300657

Log:
  Align radiotap structures in ral(4)
  
  Currently all radiotap structures in ral(4) are packed, but are not
  aligned, which causes ral based devices to crash when one does
  'ifconfig wlan0 up' for a wlan interface with a ral wlandev on arches
  that care about structure alignment (e.g., MIPS).
  
  Adding an aligned attribute helps fix this problem and ral devices
  can be properly brought up.
  
  Reviewed by:	adrian
  Sponsored by:	Smartcom - Bulgaria AD

Modified:
  head/sys/dev/ral/rt2661var.h
  head/sys/dev/ral/rt2860var.h

Modified: head/sys/dev/ral/rt2661var.h
==============================================================================
--- head/sys/dev/ral/rt2661var.h	Wed May 25 06:15:26 2016	(r300656)
+++ head/sys/dev/ral/rt2661var.h	Wed May 25 06:29:23 2016	(r300657)
@@ -26,7 +26,7 @@ struct rt2661_rx_radiotap_header {
 	uint16_t	wr_chan_flags;
 	int8_t		wr_antsignal;
 	int8_t		wr_antnoise;
-} __packed;
+} __packed __aligned(8);
 
 #define RT2661_RX_RADIOTAP_PRESENT					\
 	((1 << IEEE80211_RADIOTAP_TSFT) |				\
@@ -42,7 +42,7 @@ struct rt2661_tx_radiotap_header {
 	uint8_t		wt_rate;
 	uint16_t	wt_chan_freq;
 	uint16_t	wt_chan_flags;
-} __packed;
+} __packed __aligned(8);
 
 #define RT2661_TX_RADIOTAP_PRESENT					\
 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\

Modified: head/sys/dev/ral/rt2860var.h
==============================================================================
--- head/sys/dev/ral/rt2860var.h	Wed May 25 06:15:26 2016	(r300656)
+++ head/sys/dev/ral/rt2860var.h	Wed May 25 06:29:23 2016	(r300657)
@@ -38,7 +38,7 @@ struct rt2860_rx_radiotap_header {
 	uint8_t		wr_antenna;
 	int8_t		wr_antsignal;
 	int8_t		wr_antnoise;
-} __packed;
+} __packed __aligned(8);
 
 #define RT2860_RX_RADIOTAP_PRESENT					\
 	((1 << IEEE80211_RADIOTAP_TSFT) |				\
@@ -55,7 +55,7 @@ struct rt2860_tx_radiotap_header {
 	uint8_t		wt_rate;
 	uint16_t	wt_chan_freq;
 	uint16_t	wt_chan_flags;
-} __packed;
+} __packed __aligned(8);
 
 #define RT2860_TX_RADIOTAP_PRESENT					\
 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605250629.u4P6TOQ6006434>