830-v6.2-ata-ahci-fix-enum-constants-for-gcc-13.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. From f07788079f515ca4a681c5f595bdad19cfbd7b1d Mon Sep 17 00:00:00 2001
  2. From: Arnd Bergmann <[email protected]>
  3. Date: Sat, 3 Dec 2022 11:54:25 +0100
  4. Subject: [PATCH] ata: ahci: fix enum constants for gcc-13
  5. gcc-13 slightly changes the type of constant expressions that are defined
  6. in an enum, which triggers a compile time sanity check in libata:
  7. linux/drivers/ata/libahci.c: In function 'ahci_led_store':
  8. linux/include/linux/compiler_types.h:357:45: error: call to '__compiletime_assert_302' declared with attribute error: BUILD_BUG_ON failed: sizeof(_s) > sizeof(long)
  9. 357 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  10. The new behavior is that sizeof() returns the same value for the
  11. constant as it does for the enum type, which is generally more sensible
  12. and consistent.
  13. The problem in libata is that it contains a single enum definition for
  14. lots of unrelated constants, some of which are large positive (unsigned)
  15. integers like 0xffffffff, while others like (1<<31) are interpreted as
  16. negative integers, and this forces the enum type to become 64 bit wide
  17. even though most constants would still fit into a signed 32-bit 'int'.
  18. Fix this by changing the entire enum definition to use BIT(x) in place
  19. of (1<<x), which results in all values being seen as 'unsigned' and
  20. fitting into an unsigned 32-bit type.
  21. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107917
  22. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405
  23. Reported-by: Luis Machado <[email protected]>
  24. Cc: [email protected]
  25. Cc: Damien Le Moal <[email protected]>
  26. Cc: [email protected]
  27. Cc: Randy Dunlap <[email protected]>
  28. Signed-off-by: Arnd Bergmann <[email protected]>
  29. Tested-by: Luis Machado <[email protected]>
  30. Signed-off-by: Damien Le Moal <[email protected]>
  31. ---
  32. drivers/ata/ahci.h | 245 +++++++++++++++++++++++----------------------
  33. 1 file changed, 123 insertions(+), 122 deletions(-)
  34. --- a/drivers/ata/ahci.h
  35. +++ b/drivers/ata/ahci.h
  36. @@ -24,6 +24,7 @@
  37. #include <linux/libata.h>
  38. #include <linux/phy/phy.h>
  39. #include <linux/regulator/consumer.h>
  40. +#include <linux/bits.h>
  41. /* Enclosure Management Control */
  42. #define EM_CTRL_MSG_TYPE 0x000f0000
  43. @@ -54,12 +55,12 @@ enum {
  44. AHCI_PORT_PRIV_FBS_DMA_SZ = AHCI_CMD_SLOT_SZ +
  45. AHCI_CMD_TBL_AR_SZ +
  46. (AHCI_RX_FIS_SZ * 16),
  47. - AHCI_IRQ_ON_SG = (1 << 31),
  48. - AHCI_CMD_ATAPI = (1 << 5),
  49. - AHCI_CMD_WRITE = (1 << 6),
  50. - AHCI_CMD_PREFETCH = (1 << 7),
  51. - AHCI_CMD_RESET = (1 << 8),
  52. - AHCI_CMD_CLR_BUSY = (1 << 10),
  53. + AHCI_IRQ_ON_SG = BIT(31),
  54. + AHCI_CMD_ATAPI = BIT(5),
  55. + AHCI_CMD_WRITE = BIT(6),
  56. + AHCI_CMD_PREFETCH = BIT(7),
  57. + AHCI_CMD_RESET = BIT(8),
  58. + AHCI_CMD_CLR_BUSY = BIT(10),
  59. RX_FIS_PIO_SETUP = 0x20, /* offset of PIO Setup FIS data */
  60. RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */
  61. @@ -77,37 +78,37 @@ enum {
  62. HOST_CAP2 = 0x24, /* host capabilities, extended */
  63. /* HOST_CTL bits */
  64. - HOST_RESET = (1 << 0), /* reset controller; self-clear */
  65. - HOST_IRQ_EN = (1 << 1), /* global IRQ enable */
  66. - HOST_MRSM = (1 << 2), /* MSI Revert to Single Message */
  67. - HOST_AHCI_EN = (1 << 31), /* AHCI enabled */
  68. + HOST_RESET = BIT(0), /* reset controller; self-clear */
  69. + HOST_IRQ_EN = BIT(1), /* global IRQ enable */
  70. + HOST_MRSM = BIT(2), /* MSI Revert to Single Message */
  71. + HOST_AHCI_EN = BIT(31), /* AHCI enabled */
  72. /* HOST_CAP bits */
  73. - HOST_CAP_SXS = (1 << 5), /* Supports External SATA */
  74. - HOST_CAP_EMS = (1 << 6), /* Enclosure Management support */
  75. - HOST_CAP_CCC = (1 << 7), /* Command Completion Coalescing */
  76. - HOST_CAP_PART = (1 << 13), /* Partial state capable */
  77. - HOST_CAP_SSC = (1 << 14), /* Slumber state capable */
  78. - HOST_CAP_PIO_MULTI = (1 << 15), /* PIO multiple DRQ support */
  79. - HOST_CAP_FBS = (1 << 16), /* FIS-based switching support */
  80. - HOST_CAP_PMP = (1 << 17), /* Port Multiplier support */
  81. - HOST_CAP_ONLY = (1 << 18), /* Supports AHCI mode only */
  82. - HOST_CAP_CLO = (1 << 24), /* Command List Override support */
  83. - HOST_CAP_LED = (1 << 25), /* Supports activity LED */
  84. - HOST_CAP_ALPM = (1 << 26), /* Aggressive Link PM support */
  85. - HOST_CAP_SSS = (1 << 27), /* Staggered Spin-up */
  86. - HOST_CAP_MPS = (1 << 28), /* Mechanical presence switch */
  87. - HOST_CAP_SNTF = (1 << 29), /* SNotification register */
  88. - HOST_CAP_NCQ = (1 << 30), /* Native Command Queueing */
  89. - HOST_CAP_64 = (1 << 31), /* PCI DAC (64-bit DMA) support */
  90. + HOST_CAP_SXS = BIT(5), /* Supports External SATA */
  91. + HOST_CAP_EMS = BIT(6), /* Enclosure Management support */
  92. + HOST_CAP_CCC = BIT(7), /* Command Completion Coalescing */
  93. + HOST_CAP_PART = BIT(13), /* Partial state capable */
  94. + HOST_CAP_SSC = BIT(14), /* Slumber state capable */
  95. + HOST_CAP_PIO_MULTI = BIT(15), /* PIO multiple DRQ support */
  96. + HOST_CAP_FBS = BIT(16), /* FIS-based switching support */
  97. + HOST_CAP_PMP = BIT(17), /* Port Multiplier support */
  98. + HOST_CAP_ONLY = BIT(18), /* Supports AHCI mode only */
  99. + HOST_CAP_CLO = BIT(24), /* Command List Override support */
  100. + HOST_CAP_LED = BIT(25), /* Supports activity LED */
  101. + HOST_CAP_ALPM = BIT(26), /* Aggressive Link PM support */
  102. + HOST_CAP_SSS = BIT(27), /* Staggered Spin-up */
  103. + HOST_CAP_MPS = BIT(28), /* Mechanical presence switch */
  104. + HOST_CAP_SNTF = BIT(29), /* SNotification register */
  105. + HOST_CAP_NCQ = BIT(30), /* Native Command Queueing */
  106. + HOST_CAP_64 = BIT(31), /* PCI DAC (64-bit DMA) support */
  107. /* HOST_CAP2 bits */
  108. - HOST_CAP2_BOH = (1 << 0), /* BIOS/OS handoff supported */
  109. - HOST_CAP2_NVMHCI = (1 << 1), /* NVMHCI supported */
  110. - HOST_CAP2_APST = (1 << 2), /* Automatic partial to slumber */
  111. - HOST_CAP2_SDS = (1 << 3), /* Support device sleep */
  112. - HOST_CAP2_SADM = (1 << 4), /* Support aggressive DevSlp */
  113. - HOST_CAP2_DESO = (1 << 5), /* DevSlp from slumber only */
  114. + HOST_CAP2_BOH = BIT(0), /* BIOS/OS handoff supported */
  115. + HOST_CAP2_NVMHCI = BIT(1), /* NVMHCI supported */
  116. + HOST_CAP2_APST = BIT(2), /* Automatic partial to slumber */
  117. + HOST_CAP2_SDS = BIT(3), /* Support device sleep */
  118. + HOST_CAP2_SADM = BIT(4), /* Support aggressive DevSlp */
  119. + HOST_CAP2_DESO = BIT(5), /* DevSlp from slumber only */
  120. /* registers for each SATA port */
  121. PORT_LST_ADDR = 0x00, /* command list DMA addr */
  122. @@ -129,24 +130,24 @@ enum {
  123. PORT_DEVSLP = 0x44, /* device sleep */
  124. /* PORT_IRQ_{STAT,MASK} bits */
  125. - PORT_IRQ_COLD_PRES = (1 << 31), /* cold presence detect */
  126. - PORT_IRQ_TF_ERR = (1 << 30), /* task file error */
  127. - PORT_IRQ_HBUS_ERR = (1 << 29), /* host bus fatal error */
  128. - PORT_IRQ_HBUS_DATA_ERR = (1 << 28), /* host bus data error */
  129. - PORT_IRQ_IF_ERR = (1 << 27), /* interface fatal error */
  130. - PORT_IRQ_IF_NONFATAL = (1 << 26), /* interface non-fatal error */
  131. - PORT_IRQ_OVERFLOW = (1 << 24), /* xfer exhausted available S/G */
  132. - PORT_IRQ_BAD_PMP = (1 << 23), /* incorrect port multiplier */
  133. -
  134. - PORT_IRQ_PHYRDY = (1 << 22), /* PhyRdy changed */
  135. - PORT_IRQ_DEV_ILCK = (1 << 7), /* device interlock */
  136. - PORT_IRQ_CONNECT = (1 << 6), /* port connect change status */
  137. - PORT_IRQ_SG_DONE = (1 << 5), /* descriptor processed */
  138. - PORT_IRQ_UNK_FIS = (1 << 4), /* unknown FIS rx'd */
  139. - PORT_IRQ_SDB_FIS = (1 << 3), /* Set Device Bits FIS rx'd */
  140. - PORT_IRQ_DMAS_FIS = (1 << 2), /* DMA Setup FIS rx'd */
  141. - PORT_IRQ_PIOS_FIS = (1 << 1), /* PIO Setup FIS rx'd */
  142. - PORT_IRQ_D2H_REG_FIS = (1 << 0), /* D2H Register FIS rx'd */
  143. + PORT_IRQ_COLD_PRES = BIT(31), /* cold presence detect */
  144. + PORT_IRQ_TF_ERR = BIT(30), /* task file error */
  145. + PORT_IRQ_HBUS_ERR = BIT(29), /* host bus fatal error */
  146. + PORT_IRQ_HBUS_DATA_ERR = BIT(28), /* host bus data error */
  147. + PORT_IRQ_IF_ERR = BIT(27), /* interface fatal error */
  148. + PORT_IRQ_IF_NONFATAL = BIT(26), /* interface non-fatal error */
  149. + PORT_IRQ_OVERFLOW = BIT(24), /* xfer exhausted available S/G */
  150. + PORT_IRQ_BAD_PMP = BIT(23), /* incorrect port multiplier */
  151. +
  152. + PORT_IRQ_PHYRDY = BIT(22), /* PhyRdy changed */
  153. + PORT_IRQ_DEV_ILCK = BIT(7), /* device interlock */
  154. + PORT_IRQ_CONNECT = BIT(6), /* port connect change status */
  155. + PORT_IRQ_SG_DONE = BIT(5), /* descriptor processed */
  156. + PORT_IRQ_UNK_FIS = BIT(4), /* unknown FIS rx'd */
  157. + PORT_IRQ_SDB_FIS = BIT(3), /* Set Device Bits FIS rx'd */
  158. + PORT_IRQ_DMAS_FIS = BIT(2), /* DMA Setup FIS rx'd */
  159. + PORT_IRQ_PIOS_FIS = BIT(1), /* PIO Setup FIS rx'd */
  160. + PORT_IRQ_D2H_REG_FIS = BIT(0), /* D2H Register FIS rx'd */
  161. PORT_IRQ_FREEZE = PORT_IRQ_HBUS_ERR |
  162. PORT_IRQ_IF_ERR |
  163. @@ -162,34 +163,34 @@ enum {
  164. PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS,
  165. /* PORT_CMD bits */
  166. - PORT_CMD_ASP = (1 << 27), /* Aggressive Slumber/Partial */
  167. - PORT_CMD_ALPE = (1 << 26), /* Aggressive Link PM enable */
  168. - PORT_CMD_ATAPI = (1 << 24), /* Device is ATAPI */
  169. - PORT_CMD_FBSCP = (1 << 22), /* FBS Capable Port */
  170. - PORT_CMD_ESP = (1 << 21), /* External Sata Port */
  171. - PORT_CMD_HPCP = (1 << 18), /* HotPlug Capable Port */
  172. - PORT_CMD_PMP = (1 << 17), /* PMP attached */
  173. - PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */
  174. - PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */
  175. - PORT_CMD_FIS_RX = (1 << 4), /* Enable FIS receive DMA engine */
  176. - PORT_CMD_CLO = (1 << 3), /* Command list override */
  177. - PORT_CMD_POWER_ON = (1 << 2), /* Power up device */
  178. - PORT_CMD_SPIN_UP = (1 << 1), /* Spin up device */
  179. - PORT_CMD_START = (1 << 0), /* Enable port DMA engine */
  180. -
  181. - PORT_CMD_ICC_MASK = (0xf << 28), /* i/f ICC state mask */
  182. - PORT_CMD_ICC_ACTIVE = (0x1 << 28), /* Put i/f in active state */
  183. - PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */
  184. - PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */
  185. + PORT_CMD_ASP = BIT(27), /* Aggressive Slumber/Partial */
  186. + PORT_CMD_ALPE = BIT(26), /* Aggressive Link PM enable */
  187. + PORT_CMD_ATAPI = BIT(24), /* Device is ATAPI */
  188. + PORT_CMD_FBSCP = BIT(22), /* FBS Capable Port */
  189. + PORT_CMD_ESP = BIT(21), /* External Sata Port */
  190. + PORT_CMD_HPCP = BIT(18), /* HotPlug Capable Port */
  191. + PORT_CMD_PMP = BIT(17), /* PMP attached */
  192. + PORT_CMD_LIST_ON = BIT(15), /* cmd list DMA engine running */
  193. + PORT_CMD_FIS_ON = BIT(14), /* FIS DMA engine running */
  194. + PORT_CMD_FIS_RX = BIT(4), /* Enable FIS receive DMA engine */
  195. + PORT_CMD_CLO = BIT(3), /* Command list override */
  196. + PORT_CMD_POWER_ON = BIT(2), /* Power up device */
  197. + PORT_CMD_SPIN_UP = BIT(1), /* Spin up device */
  198. + PORT_CMD_START = BIT(0), /* Enable port DMA engine */
  199. +
  200. + PORT_CMD_ICC_MASK = (0xfu << 28), /* i/f ICC state mask */
  201. + PORT_CMD_ICC_ACTIVE = (0x1u << 28), /* Put i/f in active state */
  202. + PORT_CMD_ICC_PARTIAL = (0x2u << 28), /* Put i/f in partial state */
  203. + PORT_CMD_ICC_SLUMBER = (0x6u << 28), /* Put i/f in slumber state */
  204. /* PORT_FBS bits */
  205. PORT_FBS_DWE_OFFSET = 16, /* FBS device with error offset */
  206. PORT_FBS_ADO_OFFSET = 12, /* FBS active dev optimization offset */
  207. PORT_FBS_DEV_OFFSET = 8, /* FBS device to issue offset */
  208. PORT_FBS_DEV_MASK = (0xf << PORT_FBS_DEV_OFFSET), /* FBS.DEV */
  209. - PORT_FBS_SDE = (1 << 2), /* FBS single device error */
  210. - PORT_FBS_DEC = (1 << 1), /* FBS device error clear */
  211. - PORT_FBS_EN = (1 << 0), /* Enable FBS */
  212. + PORT_FBS_SDE = BIT(2), /* FBS single device error */
  213. + PORT_FBS_DEC = BIT(1), /* FBS device error clear */
  214. + PORT_FBS_EN = BIT(0), /* Enable FBS */
  215. /* PORT_DEVSLP bits */
  216. PORT_DEVSLP_DM_OFFSET = 25, /* DITO multiplier offset */
  217. @@ -197,50 +198,50 @@ enum {
  218. PORT_DEVSLP_DITO_OFFSET = 15, /* DITO offset */
  219. PORT_DEVSLP_MDAT_OFFSET = 10, /* Minimum assertion time */
  220. PORT_DEVSLP_DETO_OFFSET = 2, /* DevSlp exit timeout */
  221. - PORT_DEVSLP_DSP = (1 << 1), /* DevSlp present */
  222. - PORT_DEVSLP_ADSE = (1 << 0), /* Aggressive DevSlp enable */
  223. + PORT_DEVSLP_DSP = BIT(1), /* DevSlp present */
  224. + PORT_DEVSLP_ADSE = BIT(0), /* Aggressive DevSlp enable */
  225. /* hpriv->flags bits */
  226. #define AHCI_HFLAGS(flags) .private_data = (void *)(flags)
  227. - AHCI_HFLAG_NO_NCQ = (1 << 0),
  228. - AHCI_HFLAG_IGN_IRQ_IF_ERR = (1 << 1), /* ignore IRQ_IF_ERR */
  229. - AHCI_HFLAG_IGN_SERR_INTERNAL = (1 << 2), /* ignore SERR_INTERNAL */
  230. - AHCI_HFLAG_32BIT_ONLY = (1 << 3), /* force 32bit */
  231. - AHCI_HFLAG_MV_PATA = (1 << 4), /* PATA port */
  232. - AHCI_HFLAG_NO_MSI = (1 << 5), /* no PCI MSI */
  233. - AHCI_HFLAG_NO_PMP = (1 << 6), /* no PMP */
  234. - AHCI_HFLAG_SECT255 = (1 << 8), /* max 255 sectors */
  235. - AHCI_HFLAG_YES_NCQ = (1 << 9), /* force NCQ cap on */
  236. - AHCI_HFLAG_NO_SUSPEND = (1 << 10), /* don't suspend */
  237. - AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = (1 << 11), /* treat SRST timeout as
  238. + AHCI_HFLAG_NO_NCQ = BIT(0),
  239. + AHCI_HFLAG_IGN_IRQ_IF_ERR = BIT(1), /* ignore IRQ_IF_ERR */
  240. + AHCI_HFLAG_IGN_SERR_INTERNAL = BIT(2), /* ignore SERR_INTERNAL */
  241. + AHCI_HFLAG_32BIT_ONLY = BIT(3), /* force 32bit */
  242. + AHCI_HFLAG_MV_PATA = BIT(4), /* PATA port */
  243. + AHCI_HFLAG_NO_MSI = BIT(5), /* no PCI MSI */
  244. + AHCI_HFLAG_NO_PMP = BIT(6), /* no PMP */
  245. + AHCI_HFLAG_SECT255 = BIT(8), /* max 255 sectors */
  246. + AHCI_HFLAG_YES_NCQ = BIT(9), /* force NCQ cap on */
  247. + AHCI_HFLAG_NO_SUSPEND = BIT(10), /* don't suspend */
  248. + AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = BIT(11), /* treat SRST timeout as
  249. link offline */
  250. - AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */
  251. - AHCI_HFLAG_NO_FPDMA_AA = (1 << 13), /* no FPDMA AA */
  252. - AHCI_HFLAG_YES_FBS = (1 << 14), /* force FBS cap on */
  253. - AHCI_HFLAG_DELAY_ENGINE = (1 << 15), /* do not start engine on
  254. + AHCI_HFLAG_NO_SNTF = BIT(12), /* no sntf */
  255. + AHCI_HFLAG_NO_FPDMA_AA = BIT(13), /* no FPDMA AA */
  256. + AHCI_HFLAG_YES_FBS = BIT(14), /* force FBS cap on */
  257. + AHCI_HFLAG_DELAY_ENGINE = BIT(15), /* do not start engine on
  258. port start (wait until
  259. error-handling stage) */
  260. - AHCI_HFLAG_NO_DEVSLP = (1 << 17), /* no device sleep */
  261. - AHCI_HFLAG_NO_FBS = (1 << 18), /* no FBS */
  262. + AHCI_HFLAG_NO_DEVSLP = BIT(17), /* no device sleep */
  263. + AHCI_HFLAG_NO_FBS = BIT(18), /* no FBS */
  264. #ifdef CONFIG_PCI_MSI
  265. - AHCI_HFLAG_MULTI_MSI = (1 << 20), /* per-port MSI(-X) */
  266. + AHCI_HFLAG_MULTI_MSI = BIT(20), /* per-port MSI(-X) */
  267. #else
  268. /* compile out MSI infrastructure */
  269. AHCI_HFLAG_MULTI_MSI = 0,
  270. #endif
  271. - AHCI_HFLAG_WAKE_BEFORE_STOP = (1 << 22), /* wake before DMA stop */
  272. - AHCI_HFLAG_YES_ALPM = (1 << 23), /* force ALPM cap on */
  273. - AHCI_HFLAG_NO_WRITE_TO_RO = (1 << 24), /* don't write to read
  274. + AHCI_HFLAG_WAKE_BEFORE_STOP = BIT(22), /* wake before DMA stop */
  275. + AHCI_HFLAG_YES_ALPM = BIT(23), /* force ALPM cap on */
  276. + AHCI_HFLAG_NO_WRITE_TO_RO = BIT(24), /* don't write to read
  277. only registers */
  278. - AHCI_HFLAG_IS_MOBILE = (1 << 25), /* mobile chipset, use
  279. + AHCI_HFLAG_IS_MOBILE = BIT(25), /* mobile chipset, use
  280. SATA_MOBILE_LPM_POLICY
  281. as default lpm_policy */
  282. - AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during
  283. + AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during
  284. suspend/resume */
  285. - AHCI_HFLAG_NO_SXS = (1 << 28), /* SXS not supported */
  286. + AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */
  287. /* ap->flags bits */
  288. @@ -256,22 +257,22 @@ enum {
  289. EM_MAX_RETRY = 5,
  290. /* em_ctl bits */
  291. - EM_CTL_RST = (1 << 9), /* Reset */
  292. - EM_CTL_TM = (1 << 8), /* Transmit Message */
  293. - EM_CTL_MR = (1 << 0), /* Message Received */
  294. - EM_CTL_ALHD = (1 << 26), /* Activity LED */
  295. - EM_CTL_XMT = (1 << 25), /* Transmit Only */
  296. - EM_CTL_SMB = (1 << 24), /* Single Message Buffer */
  297. - EM_CTL_SGPIO = (1 << 19), /* SGPIO messages supported */
  298. - EM_CTL_SES = (1 << 18), /* SES-2 messages supported */
  299. - EM_CTL_SAFTE = (1 << 17), /* SAF-TE messages supported */
  300. - EM_CTL_LED = (1 << 16), /* LED messages supported */
  301. + EM_CTL_RST = BIT(9), /* Reset */
  302. + EM_CTL_TM = BIT(8), /* Transmit Message */
  303. + EM_CTL_MR = BIT(0), /* Message Received */
  304. + EM_CTL_ALHD = BIT(26), /* Activity LED */
  305. + EM_CTL_XMT = BIT(25), /* Transmit Only */
  306. + EM_CTL_SMB = BIT(24), /* Single Message Buffer */
  307. + EM_CTL_SGPIO = BIT(19), /* SGPIO messages supported */
  308. + EM_CTL_SES = BIT(18), /* SES-2 messages supported */
  309. + EM_CTL_SAFTE = BIT(17), /* SAF-TE messages supported */
  310. + EM_CTL_LED = BIT(16), /* LED messages supported */
  311. /* em message type */
  312. - EM_MSG_TYPE_LED = (1 << 0), /* LED */
  313. - EM_MSG_TYPE_SAFTE = (1 << 1), /* SAF-TE */
  314. - EM_MSG_TYPE_SES2 = (1 << 2), /* SES-2 */
  315. - EM_MSG_TYPE_SGPIO = (1 << 3), /* SGPIO */
  316. + EM_MSG_TYPE_LED = BIT(0), /* LED */
  317. + EM_MSG_TYPE_SAFTE = BIT(1), /* SAF-TE */
  318. + EM_MSG_TYPE_SES2 = BIT(2), /* SES-2 */
  319. + EM_MSG_TYPE_SGPIO = BIT(3), /* SGPIO */
  320. };
  321. struct ahci_cmd_hdr {