aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/phy.h')
-rw-r--r--drivers/scsi/isci/phy.h155
1 files changed, 59 insertions, 96 deletions
diff --git a/drivers/scsi/isci/phy.h b/drivers/scsi/isci/phy.h
index 67699c8e321c..0e45833ba06d 100644
--- a/drivers/scsi/isci/phy.h
+++ b/drivers/scsi/isci/phy.h
@@ -103,7 +103,6 @@ struct isci_phy {
103 struct scu_transport_layer_registers __iomem *transport_layer_registers; 103 struct scu_transport_layer_registers __iomem *transport_layer_registers;
104 struct scu_link_layer_registers __iomem *link_layer_registers; 104 struct scu_link_layer_registers __iomem *link_layer_registers;
105 struct asd_sas_phy sas_phy; 105 struct asd_sas_phy sas_phy;
106 struct isci_port *isci_port;
107 u8 sas_addr[SAS_ADDR_SIZE]; 106 u8 sas_addr[SAS_ADDR_SIZE];
108 union { 107 union {
109 struct sas_identify_frame iaf; 108 struct sas_identify_frame iaf;
@@ -344,101 +343,65 @@ enum sci_phy_counter_id {
344 SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR 343 SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
345}; 344};
346 345
347enum sci_phy_states { 346/**
348 /** 347 * enum sci_phy_states - phy state machine states
349 * Simply the initial state for the base domain state machine. 348 * @SCI_PHY_INITIAL: Simply the initial state for the base domain state
350 */ 349 * machine.
351 SCI_PHY_INITIAL, 350 * @SCI_PHY_STOPPED: phy has successfully been stopped. In this state
352 351 * no new IO operations are permitted on this phy.
353 /** 352 * @SCI_PHY_STARTING: the phy is in the process of becomming ready. In
354 * This state indicates that the phy has successfully been stopped. 353 * this state no new IO operations are permitted on
355 * In this state no new IO operations are permitted on this phy. 354 * this phy.
356 * This state is entered from the INITIAL state. 355 * @SCI_PHY_SUB_INITIAL: Initial state
357 * This state is entered from the STARTING state. 356 * @SCI_PHY_SUB_AWAIT_OSSP_EN: Wait state for the hardware OSSP event
358 * This state is entered from the READY state. 357 * type notification
359 * This state is entered from the RESETTING state. 358 * @SCI_PHY_SUB_AWAIT_SAS_SPEED_EN: Wait state for the PHY speed
360 */ 359 * notification
361 SCI_PHY_STOPPED, 360 * @SCI_PHY_SUB_AWAIT_IAF_UF: Wait state for the IAF Unsolicited frame
362 361 * notification
363 /** 362 * @SCI_PHY_SUB_AWAIT_SAS_POWER: Wait state for the request to consume
364 * This state indicates that the phy is in the process of becomming 363 * power
365 * ready. In this state no new IO operations are permitted on this phy. 364 * @SCI_PHY_SUB_AWAIT_SATA_POWER: Wait state for request to consume
366 * This state is entered from the STOPPED state. 365 * power
367 * This state is entered from the READY state. 366 * @SCI_PHY_SUB_AWAIT_SATA_PHY_EN: Wait state for the SATA PHY
368 * This state is entered from the RESETTING state. 367 * notification
369 */ 368 * @SCI_PHY_SUB_AWAIT_SATA_SPEED_EN: Wait for the SATA PHY speed
370 SCI_PHY_STARTING, 369 * notification
371 370 * @SCI_PHY_SUB_AWAIT_SIG_FIS_UF: Wait state for the SIGNATURE FIS
372 /** 371 * unsolicited frame notification
373 * Initial state 372 * @SCI_PHY_SUB_FINAL: Exit state for this state machine
374 */ 373 * @SCI_PHY_READY: phy is now ready. Thus, the user is able to perform
375 SCI_PHY_SUB_INITIAL, 374 * IO operations utilizing this phy as long as it is
376 375 * currently part of a valid port. This state is
377 /** 376 * entered from the STARTING state.
378 * Wait state for the hardware OSSP event type notification 377 * @SCI_PHY_RESETTING: phy is in the process of being reset. In this
379 */ 378 * state no new IO operations are permitted on this
380 SCI_PHY_SUB_AWAIT_OSSP_EN, 379 * phy. This state is entered from the READY state.
381 380 * @SCI_PHY_FINAL: Simply the final state for the base phy state
382 /** 381 * machine.
383 * Wait state for the PHY speed notification 382 */
384 */ 383#define PHY_STATES {\
385 SCI_PHY_SUB_AWAIT_SAS_SPEED_EN, 384 C(PHY_INITIAL),\
386 385 C(PHY_STOPPED),\
387 /** 386 C(PHY_STARTING),\
388 * Wait state for the IAF Unsolicited frame notification 387 C(PHY_SUB_INITIAL),\
389 */ 388 C(PHY_SUB_AWAIT_OSSP_EN),\
390 SCI_PHY_SUB_AWAIT_IAF_UF, 389 C(PHY_SUB_AWAIT_SAS_SPEED_EN),\
391 390 C(PHY_SUB_AWAIT_IAF_UF),\
392 /** 391 C(PHY_SUB_AWAIT_SAS_POWER),\
393 * Wait state for the request to consume power 392 C(PHY_SUB_AWAIT_SATA_POWER),\
394 */ 393 C(PHY_SUB_AWAIT_SATA_PHY_EN),\
395 SCI_PHY_SUB_AWAIT_SAS_POWER, 394 C(PHY_SUB_AWAIT_SATA_SPEED_EN),\
396 395 C(PHY_SUB_AWAIT_SIG_FIS_UF),\
397 /** 396 C(PHY_SUB_FINAL),\
398 * Wait state for request to consume power 397 C(PHY_READY),\
399 */ 398 C(PHY_RESETTING),\
400 SCI_PHY_SUB_AWAIT_SATA_POWER, 399 C(PHY_FINAL),\
401 400 }
402 /** 401#undef C
403 * Wait state for the SATA PHY notification 402#define C(a) SCI_##a
404 */ 403enum sci_phy_states PHY_STATES;
405 SCI_PHY_SUB_AWAIT_SATA_PHY_EN, 404#undef C
406
407 /**
408 * Wait for the SATA PHY speed notification
409 */
410 SCI_PHY_SUB_AWAIT_SATA_SPEED_EN,
411
412 /**
413 * Wait state for the SIGNATURE FIS unsolicited frame notification
414 */
415 SCI_PHY_SUB_AWAIT_SIG_FIS_UF,
416
417 /**
418 * Exit state for this state machine
419 */
420 SCI_PHY_SUB_FINAL,
421
422 /**
423 * This state indicates the the phy is now ready. Thus, the user
424 * is able to perform IO operations utilizing this phy as long as it
425 * is currently part of a valid port.
426 * This state is entered from the STARTING state.
427 */
428 SCI_PHY_READY,
429
430 /**
431 * This state indicates that the phy is in the process of being reset.
432 * In this state no new IO operations are permitted on this phy.
433 * This state is entered from the READY state.
434 */
435 SCI_PHY_RESETTING,
436
437 /**
438 * Simply the final state for the base phy state machine.
439 */
440 SCI_PHY_FINAL,
441};
442 405
443void sci_phy_construct( 406void sci_phy_construct(
444 struct isci_phy *iphy, 407 struct isci_phy *iphy,