svn commit: r300657 - head/sys/dev/ral

Stanislav Galabov sgalabov at FreeBSD.org
Wed May 25 06:29:25 UTC 2016


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) |				\


More information about the svn-src-all mailing list