[SCSI] isci: debug, provide state-enum-to-string conversions
[deliverable/linux.git] / drivers / scsi / isci / phy.h
index a5e1a9e577b04d2e0de8aff89b7c86dc9f655a47..0e45833ba06d92696cc07f5f10fd79085d794191 100644 (file)
@@ -343,101 +343,65 @@ enum sci_phy_counter_id {
        SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
 };
 
-enum sci_phy_states {
-       /**
-        * Simply the initial state for the base domain state machine.
-        */
-       SCI_PHY_INITIAL,
-
-       /**
-        * This state indicates that the phy has successfully been stopped.
-        * In this state no new IO operations are permitted on this phy.
-        * This state is entered from the INITIAL state.
-        * This state is entered from the STARTING state.
-        * This state is entered from the READY state.
-        * This state is entered from the RESETTING state.
-        */
-       SCI_PHY_STOPPED,
-
-       /**
-        * This state indicates that the phy is in the process of becomming
-        * ready.  In this state no new IO operations are permitted on this phy.
-        * This state is entered from the STOPPED state.
-        * This state is entered from the READY state.
-        * This state is entered from the RESETTING state.
-        */
-       SCI_PHY_STARTING,
-
-       /**
-        * Initial state
-        */
-       SCI_PHY_SUB_INITIAL,
-
-       /**
-        * Wait state for the hardware OSSP event type notification
-        */
-       SCI_PHY_SUB_AWAIT_OSSP_EN,
-
-       /**
-        * Wait state for the PHY speed notification
-        */
-       SCI_PHY_SUB_AWAIT_SAS_SPEED_EN,
-
-       /**
-        * Wait state for the IAF Unsolicited frame notification
-        */
-       SCI_PHY_SUB_AWAIT_IAF_UF,
-
-       /**
-        * Wait state for the request to consume power
-        */
-       SCI_PHY_SUB_AWAIT_SAS_POWER,
-
-       /**
-        * Wait state for request to consume power
-        */
-       SCI_PHY_SUB_AWAIT_SATA_POWER,
-
-       /**
-        * Wait state for the SATA PHY notification
-        */
-       SCI_PHY_SUB_AWAIT_SATA_PHY_EN,
-
-       /**
-        * Wait for the SATA PHY speed notification
-        */
-       SCI_PHY_SUB_AWAIT_SATA_SPEED_EN,
-
-       /**
-        * Wait state for the SIGNATURE FIS unsolicited frame notification
-        */
-       SCI_PHY_SUB_AWAIT_SIG_FIS_UF,
-
-       /**
-        * Exit state for this state machine
-        */
-       SCI_PHY_SUB_FINAL,
-
-       /**
-        * This state indicates the the phy is now ready.  Thus, the user
-        * is able to perform IO operations utilizing this phy as long as it
-        * is currently part of a valid port.
-        * This state is entered from the STARTING state.
-        */
-       SCI_PHY_READY,
-
-       /**
-        * This state indicates that the phy is in the process of being reset.
-        * In this state no new IO operations are permitted on this phy.
-        * This state is entered from the READY state.
-        */
-       SCI_PHY_RESETTING,
-
-       /**
-        * Simply the final state for the base phy state machine.
-        */
-       SCI_PHY_FINAL,
-};
+/**
+ * enum sci_phy_states - phy state machine states
+ * @SCI_PHY_INITIAL: Simply the initial state for the base domain state
+ *                  machine.
+ * @SCI_PHY_STOPPED: phy has successfully been stopped.  In this state
+ *                  no new IO operations are permitted on this phy.
+ * @SCI_PHY_STARTING: the phy is in the process of becomming ready.  In
+ *                   this state no new IO operations are permitted on
+ *                   this phy.
+ * @SCI_PHY_SUB_INITIAL: Initial state
+ * @SCI_PHY_SUB_AWAIT_OSSP_EN: Wait state for the hardware OSSP event
+ *                            type notification
+ * @SCI_PHY_SUB_AWAIT_SAS_SPEED_EN: Wait state for the PHY speed
+ *                                 notification
+ * @SCI_PHY_SUB_AWAIT_IAF_UF: Wait state for the IAF Unsolicited frame
+ *                           notification
+ * @SCI_PHY_SUB_AWAIT_SAS_POWER: Wait state for the request to consume
+ *                              power
+ * @SCI_PHY_SUB_AWAIT_SATA_POWER: Wait state for request to consume
+ *                               power
+ * @SCI_PHY_SUB_AWAIT_SATA_PHY_EN: Wait state for the SATA PHY
+ *                                notification
+ * @SCI_PHY_SUB_AWAIT_SATA_SPEED_EN: Wait for the SATA PHY speed
+ *                                  notification
+ * @SCI_PHY_SUB_AWAIT_SIG_FIS_UF: Wait state for the SIGNATURE FIS
+ *                               unsolicited frame notification
+ * @SCI_PHY_SUB_FINAL: Exit state for this state machine
+ * @SCI_PHY_READY: phy is now ready.  Thus, the user is able to perform
+ *                IO operations utilizing this phy as long as it is
+ *                currently part of a valid port.  This state is
+ *                entered from the STARTING state.
+ * @SCI_PHY_RESETTING: phy is in the process of being reset.  In this
+ *                    state no new IO operations are permitted on this
+ *                    phy.  This state is entered from the READY state.
+ * @SCI_PHY_FINAL: Simply the final state for the base phy state
+ *                machine.
+ */
+#define PHY_STATES {\
+       C(PHY_INITIAL),\
+       C(PHY_STOPPED),\
+       C(PHY_STARTING),\
+       C(PHY_SUB_INITIAL),\
+       C(PHY_SUB_AWAIT_OSSP_EN),\
+       C(PHY_SUB_AWAIT_SAS_SPEED_EN),\
+       C(PHY_SUB_AWAIT_IAF_UF),\
+       C(PHY_SUB_AWAIT_SAS_POWER),\
+       C(PHY_SUB_AWAIT_SATA_POWER),\
+       C(PHY_SUB_AWAIT_SATA_PHY_EN),\
+       C(PHY_SUB_AWAIT_SATA_SPEED_EN),\
+       C(PHY_SUB_AWAIT_SIG_FIS_UF),\
+       C(PHY_SUB_FINAL),\
+       C(PHY_READY),\
+       C(PHY_RESETTING),\
+       C(PHY_FINAL),\
+       }
+#undef C
+#define C(a) SCI_##a
+enum sci_phy_states PHY_STATES;
+#undef C
 
 void sci_phy_construct(
        struct isci_phy *iphy,
This page took 0.032866 seconds and 5 git commands to generate.