diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_port.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_port.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c index fff96226a383..3f8e9d6066ec 100644 --- a/drivers/scsi/bfa/bfa_port.c +++ b/drivers/scsi/bfa/bfa_port.c | |||
@@ -15,6 +15,7 @@ | |||
15 | * General Public License for more details. | 15 | * General Public License for more details. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "bfad_drv.h" | ||
18 | #include "bfa_defs_svc.h" | 19 | #include "bfa_defs_svc.h" |
19 | #include "bfa_port.h" | 20 | #include "bfa_port.h" |
20 | #include "bfi.h" | 21 | #include "bfi.h" |
@@ -29,14 +30,14 @@ static void | |||
29 | bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) | 30 | bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) |
30 | { | 31 | { |
31 | u32 *dip = (u32 *) stats; | 32 | u32 *dip = (u32 *) stats; |
32 | u32 t0, t1; | 33 | __be32 t0, t1; |
33 | int i; | 34 | int i; |
34 | 35 | ||
35 | for (i = 0; i < sizeof(union bfa_port_stats_u)/sizeof(u32); | 36 | for (i = 0; i < sizeof(union bfa_port_stats_u)/sizeof(u32); |
36 | i += 2) { | 37 | i += 2) { |
37 | t0 = dip[i]; | 38 | t0 = dip[i]; |
38 | t1 = dip[i + 1]; | 39 | t1 = dip[i + 1]; |
39 | #ifdef __BIGENDIAN | 40 | #ifdef __BIG_ENDIAN |
40 | dip[i] = be32_to_cpu(t0); | 41 | dip[i] = be32_to_cpu(t0); |
41 | dip[i + 1] = be32_to_cpu(t1); | 42 | dip[i + 1] = be32_to_cpu(t1); |
42 | #else | 43 | #else |
@@ -96,13 +97,13 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) | |||
96 | port->stats_busy = BFA_FALSE; | 97 | port->stats_busy = BFA_FALSE; |
97 | 98 | ||
98 | if (status == BFA_STATUS_OK) { | 99 | if (status == BFA_STATUS_OK) { |
99 | struct bfa_timeval_s tv; | 100 | struct timeval tv; |
100 | 101 | ||
101 | memcpy(port->stats, port->stats_dma.kva, | 102 | memcpy(port->stats, port->stats_dma.kva, |
102 | sizeof(union bfa_port_stats_u)); | 103 | sizeof(union bfa_port_stats_u)); |
103 | bfa_port_stats_swap(port, port->stats); | 104 | bfa_port_stats_swap(port, port->stats); |
104 | 105 | ||
105 | bfa_os_gettimeofday(&tv); | 106 | do_gettimeofday(&tv); |
106 | port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time; | 107 | port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time; |
107 | } | 108 | } |
108 | 109 | ||
@@ -124,7 +125,7 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) | |||
124 | static void | 125 | static void |
125 | bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) | 126 | bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) |
126 | { | 127 | { |
127 | struct bfa_timeval_s tv; | 128 | struct timeval tv; |
128 | 129 | ||
129 | port->stats_status = status; | 130 | port->stats_status = status; |
130 | port->stats_busy = BFA_FALSE; | 131 | port->stats_busy = BFA_FALSE; |
@@ -132,7 +133,7 @@ bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) | |||
132 | /* | 133 | /* |
133 | * re-initialize time stamp for stats reset | 134 | * re-initialize time stamp for stats reset |
134 | */ | 135 | */ |
135 | bfa_os_gettimeofday(&tv); | 136 | do_gettimeofday(&tv); |
136 | port->stats_reset_time = tv.tv_sec; | 137 | port->stats_reset_time = tv.tv_sec; |
137 | 138 | ||
138 | if (port->stats_cbfn) { | 139 | if (port->stats_cbfn) { |
@@ -185,7 +186,7 @@ bfa_port_isr(void *cbarg, struct bfi_mbmsg_s *m) | |||
185 | break; | 186 | break; |
186 | 187 | ||
187 | default: | 188 | default: |
188 | bfa_assert(0); | 189 | WARN_ON(1); |
189 | } | 190 | } |
190 | } | 191 | } |
191 | 192 | ||
@@ -432,9 +433,9 @@ void | |||
432 | bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, | 433 | bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, |
433 | void *dev, struct bfa_trc_mod_s *trcmod) | 434 | void *dev, struct bfa_trc_mod_s *trcmod) |
434 | { | 435 | { |
435 | struct bfa_timeval_s tv; | 436 | struct timeval tv; |
436 | 437 | ||
437 | bfa_assert(port); | 438 | WARN_ON(!port); |
438 | 439 | ||
439 | port->dev = dev; | 440 | port->dev = dev; |
440 | port->ioc = ioc; | 441 | port->ioc = ioc; |
@@ -447,27 +448,13 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, | |||
447 | 448 | ||
448 | bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); | 449 | bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); |
449 | bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); | 450 | bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); |
450 | bfa_ioc_hbfail_register(port->ioc, &port->hbfail); | 451 | list_add_tail(&port->hbfail.qe, &port->ioc->hb_notify_q); |
451 | 452 | ||
452 | /* | 453 | /* |
453 | * initialize time stamp for stats reset | 454 | * initialize time stamp for stats reset |
454 | */ | 455 | */ |
455 | bfa_os_gettimeofday(&tv); | 456 | do_gettimeofday(&tv); |
456 | port->stats_reset_time = tv.tv_sec; | 457 | port->stats_reset_time = tv.tv_sec; |
457 | 458 | ||
458 | bfa_trc(port, 0); | 459 | bfa_trc(port, 0); |
459 | } | 460 | } |
460 | |||
461 | /* | ||
462 | * bfa_port_detach() | ||
463 | * | ||
464 | * | ||
465 | * @param[in] port - Pointer to the Port module data structure | ||
466 | * | ||
467 | * @return void | ||
468 | */ | ||
469 | void | ||
470 | bfa_port_detach(struct bfa_port_s *port) | ||
471 | { | ||
472 | bfa_trc(port, 0); | ||
473 | } | ||