diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-01-17 12:02:15 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 12:29:32 -0500 |
commit | a824ebb37c1a1c5fd8e19b47bf5c14cb7b419b48 (patch) | |
tree | 1aa1f3731409f448b40f5c5b9e49c9e85eedff1d /drivers/scsi/qla2xxx/qla_mbx.c | |
parent | 50db6b134c31351a03cec9d2a7f9e61f63a5ce9f (diff) |
[SCSI] qla2xxx: Code cleanups.
- make the following needlessly global code static:
- qla_attr.c: qla24xx_vport_delete()
- qla_attr.c: qla24xx_vport_disable()
- qla_mid.c: qla24xx_allocate_vp_id()
- qla_mid.c: qla24xx_find_vhost_by_name()
- qla_mid.c: qla2x00_do_dpc_vp()
- qla_os.c: struct qla2x00_driver_template
- qla_os.c: qla2x00_stop_timer()
- qla_os.c: qla2x00_mem_alloc()
- qla_os.c: qla2x00_mem_free()
- qla_sup.c: qla2x00_lock_nvram_access()
- qla_sup.c: qla2x00_unlock_nvram_access()
- qla_sup.c: qla2x00_get_nvram_word()
- qla_sup.c: qla2x00_write_nvram_word()
- #if 0 the following unused global functions:
- qla_mbx.c: qla2x00_system_error()
- qla_os.c: remove some unneeded function prototypes
- removed unused functions:
- qla_dbg.c: qla2x00_dump_pkt()
- qla_mbx.c: qla2x00_get_serdes_params()
- qla_mbx.c: qla2x00_get_idma_speed()
- qla_mbx.c: qla24xx_get_vp_database()
- qla_mbx.c: qla24xx_get_vp_entry()
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Small modifications and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 177 |
1 files changed, 3 insertions, 174 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index d23d6fcfb225..ee7899d31e18 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2248,6 +2248,8 @@ atarget_done: | |||
2248 | return rval; | 2248 | return rval; |
2249 | } | 2249 | } |
2250 | 2250 | ||
2251 | #if 0 | ||
2252 | |||
2251 | int | 2253 | int |
2252 | qla2x00_system_error(scsi_qla_host_t *ha) | 2254 | qla2x00_system_error(scsi_qla_host_t *ha) |
2253 | { | 2255 | { |
@@ -2277,47 +2279,7 @@ qla2x00_system_error(scsi_qla_host_t *ha) | |||
2277 | return rval; | 2279 | return rval; |
2278 | } | 2280 | } |
2279 | 2281 | ||
2280 | /** | 2282 | #endif /* 0 */ |
2281 | * qla2x00_get_serdes_params() - | ||
2282 | * @ha: HA context | ||
2283 | * | ||
2284 | * Returns | ||
2285 | */ | ||
2286 | int | ||
2287 | qla2x00_get_serdes_params(scsi_qla_host_t *ha, uint16_t *sw_em_1g, | ||
2288 | uint16_t *sw_em_2g, uint16_t *sw_em_4g) | ||
2289 | { | ||
2290 | int rval; | ||
2291 | mbx_cmd_t mc; | ||
2292 | mbx_cmd_t *mcp = &mc; | ||
2293 | |||
2294 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2295 | |||
2296 | mcp->mb[0] = MBC_SERDES_PARAMS; | ||
2297 | mcp->mb[1] = 0; | ||
2298 | mcp->out_mb = MBX_1|MBX_0; | ||
2299 | mcp->in_mb = MBX_4|MBX_3|MBX_2|MBX_0; | ||
2300 | mcp->tov = 30; | ||
2301 | mcp->flags = 0; | ||
2302 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2303 | |||
2304 | if (rval != QLA_SUCCESS) { | ||
2305 | /*EMPTY*/ | ||
2306 | DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__, | ||
2307 | ha->host_no, rval, mcp->mb[0])); | ||
2308 | } else { | ||
2309 | DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); | ||
2310 | |||
2311 | if (sw_em_1g) | ||
2312 | *sw_em_1g = mcp->mb[2]; | ||
2313 | if (sw_em_2g) | ||
2314 | *sw_em_2g = mcp->mb[3]; | ||
2315 | if (sw_em_4g) | ||
2316 | *sw_em_4g = mcp->mb[4]; | ||
2317 | } | ||
2318 | |||
2319 | return rval; | ||
2320 | } | ||
2321 | 2283 | ||
2322 | /** | 2284 | /** |
2323 | * qla2x00_set_serdes_params() - | 2285 | * qla2x00_set_serdes_params() - |
@@ -2466,49 +2428,6 @@ qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr, | |||
2466 | } | 2428 | } |
2467 | 2429 | ||
2468 | int | 2430 | int |
2469 | qla2x00_get_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, | ||
2470 | uint16_t *port_speed, uint16_t *mb) | ||
2471 | { | ||
2472 | int rval; | ||
2473 | mbx_cmd_t mc; | ||
2474 | mbx_cmd_t *mcp = &mc; | ||
2475 | |||
2476 | if (!IS_IIDMA_CAPABLE(ha)) | ||
2477 | return QLA_FUNCTION_FAILED; | ||
2478 | |||
2479 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2480 | |||
2481 | mcp->mb[0] = MBC_PORT_PARAMS; | ||
2482 | mcp->mb[1] = loop_id; | ||
2483 | mcp->mb[2] = mcp->mb[3] = mcp->mb[4] = mcp->mb[5] = 0; | ||
2484 | mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | ||
2485 | mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0; | ||
2486 | mcp->tov = 30; | ||
2487 | mcp->flags = 0; | ||
2488 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2489 | |||
2490 | /* Return mailbox statuses. */ | ||
2491 | if (mb != NULL) { | ||
2492 | mb[0] = mcp->mb[0]; | ||
2493 | mb[1] = mcp->mb[1]; | ||
2494 | mb[3] = mcp->mb[3]; | ||
2495 | mb[4] = mcp->mb[4]; | ||
2496 | mb[5] = mcp->mb[5]; | ||
2497 | } | ||
2498 | |||
2499 | if (rval != QLA_SUCCESS) { | ||
2500 | DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, | ||
2501 | ha->host_no, rval)); | ||
2502 | } else { | ||
2503 | DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); | ||
2504 | if (port_speed) | ||
2505 | *port_speed = mcp->mb[3]; | ||
2506 | } | ||
2507 | |||
2508 | return rval; | ||
2509 | } | ||
2510 | |||
2511 | int | ||
2512 | qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, | 2431 | qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, |
2513 | uint16_t port_speed, uint16_t *mb) | 2432 | uint16_t port_speed, uint16_t *mb) |
2514 | { | 2433 | { |
@@ -2551,96 +2470,6 @@ qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, | |||
2551 | return rval; | 2470 | return rval; |
2552 | } | 2471 | } |
2553 | 2472 | ||
2554 | /* | ||
2555 | * qla24xx_get_vp_database | ||
2556 | * Get the VP's database for all configured ports. | ||
2557 | * | ||
2558 | * Input: | ||
2559 | * ha = adapter block pointer. | ||
2560 | * size = size of initialization control block. | ||
2561 | * | ||
2562 | * Returns: | ||
2563 | * qla2x00 local function return status code. | ||
2564 | * | ||
2565 | * Context: | ||
2566 | * Kernel context. | ||
2567 | */ | ||
2568 | int | ||
2569 | qla24xx_get_vp_database(scsi_qla_host_t *ha, uint16_t size) | ||
2570 | { | ||
2571 | int rval; | ||
2572 | mbx_cmd_t mc; | ||
2573 | mbx_cmd_t *mcp = &mc; | ||
2574 | |||
2575 | DEBUG11(printk("scsi(%ld):%s - entered.\n", | ||
2576 | ha->host_no, __func__)); | ||
2577 | |||
2578 | mcp->mb[0] = MBC_MID_GET_VP_DATABASE; | ||
2579 | mcp->mb[2] = MSW(ha->init_cb_dma); | ||
2580 | mcp->mb[3] = LSW(ha->init_cb_dma); | ||
2581 | mcp->mb[4] = 0; | ||
2582 | mcp->mb[5] = 0; | ||
2583 | mcp->mb[6] = MSW(MSD(ha->init_cb_dma)); | ||
2584 | mcp->mb[7] = LSW(MSD(ha->init_cb_dma)); | ||
2585 | mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; | ||
2586 | mcp->in_mb = MBX_1|MBX_0; | ||
2587 | mcp->buf_size = size; | ||
2588 | mcp->flags = MBX_DMA_OUT; | ||
2589 | mcp->tov = MBX_TOV_SECONDS; | ||
2590 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2591 | |||
2592 | if (rval != QLA_SUCCESS) { | ||
2593 | /*EMPTY*/ | ||
2594 | DEBUG2_3_11(printk("%s(%ld): failed=%x " | ||
2595 | "mb0=%x.\n", | ||
2596 | __func__, ha->host_no, rval, mcp->mb[0])); | ||
2597 | } else { | ||
2598 | /*EMPTY*/ | ||
2599 | DEBUG11(printk("%s(%ld): done.\n", | ||
2600 | __func__, ha->host_no)); | ||
2601 | } | ||
2602 | |||
2603 | return rval; | ||
2604 | } | ||
2605 | |||
2606 | int | ||
2607 | qla24xx_get_vp_entry(scsi_qla_host_t *ha, uint16_t size, int vp_id) | ||
2608 | { | ||
2609 | int rval; | ||
2610 | mbx_cmd_t mc; | ||
2611 | mbx_cmd_t *mcp = &mc; | ||
2612 | |||
2613 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2614 | |||
2615 | mcp->mb[0] = MBC_MID_GET_VP_ENTRY; | ||
2616 | mcp->mb[2] = MSW(ha->init_cb_dma); | ||
2617 | mcp->mb[3] = LSW(ha->init_cb_dma); | ||
2618 | mcp->mb[4] = 0; | ||
2619 | mcp->mb[5] = 0; | ||
2620 | mcp->mb[6] = MSW(MSD(ha->init_cb_dma)); | ||
2621 | mcp->mb[7] = LSW(MSD(ha->init_cb_dma)); | ||
2622 | mcp->mb[9] = vp_id; | ||
2623 | mcp->out_mb = MBX_9|MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; | ||
2624 | mcp->in_mb = MBX_0; | ||
2625 | mcp->buf_size = size; | ||
2626 | mcp->flags = MBX_DMA_OUT; | ||
2627 | mcp->tov = 30; | ||
2628 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2629 | |||
2630 | if (rval != QLA_SUCCESS) { | ||
2631 | /*EMPTY*/ | ||
2632 | DEBUG2_3_11(printk("qla24xx_get_vp_entry(%ld): failed=%x " | ||
2633 | "mb0=%x.\n", | ||
2634 | ha->host_no, rval, mcp->mb[0])); | ||
2635 | } else { | ||
2636 | /*EMPTY*/ | ||
2637 | DEBUG11(printk("qla24xx_get_vp_entry(%ld): done.\n", | ||
2638 | ha->host_no)); | ||
2639 | } | ||
2640 | |||
2641 | return rval; | ||
2642 | } | ||
2643 | |||
2644 | void | 2473 | void |
2645 | qla24xx_report_id_acquisition(scsi_qla_host_t *ha, | 2474 | qla24xx_report_id_acquisition(scsi_qla_host_t *ha, |
2646 | struct vp_rpt_id_entry_24xx *rptid_entry) | 2475 | struct vp_rpt_id_entry_24xx *rptid_entry) |