diff options
author | Hannes Reinecke <hare@suse.de> | 2005-08-01 03:52:56 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-08-03 12:48:03 -0400 |
commit | a4b53a11806f5c0824eb4115b1de8206ed7bb89a (patch) | |
tree | c86d2e9d7359bcf6bea44373d0ced18bb4be453e /drivers/scsi/aic7xxx | |
parent | 73a25462100772b72a5d62fd66dff01b53018618 (diff) |
[SCSI] aic79xx: DV parameter settings
This patch updates various scsi_transport_spi parameters with the actual
parameters used by the driver internally.
Domain Validation for all devices should now work properly.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 231 |
1 files changed, 218 insertions, 13 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 70997ca28baa..cf8e0ca830a2 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
@@ -1636,9 +1636,9 @@ ahd_send_async(struct ahd_softc *ahd, char channel, | |||
1636 | spi_period(starget) = tinfo->curr.period; | 1636 | spi_period(starget) = tinfo->curr.period; |
1637 | spi_width(starget) = tinfo->curr.width; | 1637 | spi_width(starget) = tinfo->curr.width; |
1638 | spi_offset(starget) = tinfo->curr.offset; | 1638 | spi_offset(starget) = tinfo->curr.offset; |
1639 | spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ; | 1639 | spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; |
1640 | spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ; | 1640 | spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; |
1641 | spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ; | 1641 | spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; |
1642 | spi_display_xfer_agreement(starget); | 1642 | spi_display_xfer_agreement(starget); |
1643 | break; | 1643 | break; |
1644 | } | 1644 | } |
@@ -2318,6 +2318,18 @@ done: | |||
2318 | 2318 | ||
2319 | static void ahd_linux_exit(void); | 2319 | static void ahd_linux_exit(void); |
2320 | 2320 | ||
2321 | static void ahd_linux_set_xferflags(struct scsi_target *starget, unsigned int ppr_options, unsigned int period) | ||
2322 | { | ||
2323 | spi_qas(starget) = (ppr_options & MSG_EXT_PPR_QAS_REQ)? 1 : 0; | ||
2324 | spi_dt(starget) = (ppr_options & MSG_EXT_PPR_DT_REQ)? 1 : 0; | ||
2325 | spi_iu(starget) = (ppr_options & MSG_EXT_PPR_IU_REQ) ? 1 : 0; | ||
2326 | spi_rd_strm(starget) = (ppr_options & MSG_EXT_PPR_RD_STRM) ? 1 : 0; | ||
2327 | spi_wr_flow(starget) = (ppr_options & MSG_EXT_PPR_WR_FLOW) ? 1 : 0; | ||
2328 | spi_pcomp_en(starget) = (ppr_options & MSG_EXT_PPR_PCOMP_EN) ? 1 : 0; | ||
2329 | spi_rti(starget) = (ppr_options & MSG_EXT_PPR_RTI) ? 1 : 0; | ||
2330 | spi_period(starget) = period; | ||
2331 | } | ||
2332 | |||
2321 | static void ahd_linux_set_width(struct scsi_target *starget, int width) | 2333 | static void ahd_linux_set_width(struct scsi_target *starget, int width) |
2322 | { | 2334 | { |
2323 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 2335 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
@@ -2343,9 +2355,14 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period) | |||
2343 | shost->this_id, starget->id, &tstate); | 2355 | shost->this_id, starget->id, &tstate); |
2344 | struct ahd_devinfo devinfo; | 2356 | struct ahd_devinfo devinfo; |
2345 | unsigned int ppr_options = tinfo->goal.ppr_options; | 2357 | unsigned int ppr_options = tinfo->goal.ppr_options; |
2358 | unsigned int dt; | ||
2346 | unsigned long flags; | 2359 | unsigned long flags; |
2347 | unsigned long offset = tinfo->goal.offset; | 2360 | unsigned long offset = tinfo->goal.offset; |
2348 | 2361 | ||
2362 | #ifdef AHD_DEBUG | ||
2363 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2364 | printf("%s: set period to %d\n", ahd_name(ahd), period); | ||
2365 | #endif | ||
2349 | if (offset == 0) | 2366 | if (offset == 0) |
2350 | offset = MAX_OFFSET; | 2367 | offset = MAX_OFFSET; |
2351 | 2368 | ||
@@ -2357,6 +2374,8 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period) | |||
2357 | ppr_options |= MSG_EXT_PPR_IU_REQ; | 2374 | ppr_options |= MSG_EXT_PPR_IU_REQ; |
2358 | } | 2375 | } |
2359 | 2376 | ||
2377 | dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2378 | |||
2360 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2379 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2361 | starget->channel + 'A', ROLE_INITIATOR); | 2380 | starget->channel + 'A', ROLE_INITIATOR); |
2362 | 2381 | ||
@@ -2366,7 +2385,11 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period) | |||
2366 | ppr_options &= MSG_EXT_PPR_QAS_REQ; | 2385 | ppr_options &= MSG_EXT_PPR_QAS_REQ; |
2367 | } | 2386 | } |
2368 | 2387 | ||
2369 | ahd_find_syncrate(ahd, &period, &ppr_options, AHD_SYNCRATE_MAX); | 2388 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2389 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | ||
2390 | |||
2391 | ahd_linux_set_xferflags(starget, ppr_options, period); | ||
2392 | |||
2370 | ahd_lock(ahd, &flags); | 2393 | ahd_lock(ahd, &flags); |
2371 | ahd_set_syncrate(ahd, &devinfo, period, offset, | 2394 | ahd_set_syncrate(ahd, &devinfo, period, offset, |
2372 | ppr_options, AHD_TRANS_GOAL, FALSE); | 2395 | ppr_options, AHD_TRANS_GOAL, FALSE); |
@@ -2385,15 +2408,24 @@ static void ahd_linux_set_offset(struct scsi_target *starget, int offset) | |||
2385 | struct ahd_devinfo devinfo; | 2408 | struct ahd_devinfo devinfo; |
2386 | unsigned int ppr_options = 0; | 2409 | unsigned int ppr_options = 0; |
2387 | unsigned int period = 0; | 2410 | unsigned int period = 0; |
2411 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2388 | unsigned long flags; | 2412 | unsigned long flags; |
2389 | 2413 | ||
2414 | #ifdef AHD_DEBUG | ||
2415 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2416 | printf("%s: set offset to %d\n", ahd_name(ahd), offset); | ||
2417 | #endif | ||
2418 | |||
2390 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2419 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2391 | starget->channel + 'A', ROLE_INITIATOR); | 2420 | starget->channel + 'A', ROLE_INITIATOR); |
2392 | if (offset != 0) { | 2421 | if (offset != 0) { |
2393 | period = tinfo->goal.period; | 2422 | period = tinfo->goal.period; |
2394 | ppr_options = tinfo->goal.ppr_options; | 2423 | ppr_options = tinfo->goal.ppr_options; |
2395 | ahd_find_syncrate(ahd, &period, &ppr_options, AHD_SYNCRATE_MAX); | 2424 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2425 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | ||
2396 | } | 2426 | } |
2427 | ahd_linux_set_xferflags(starget, ppr_options, period); | ||
2428 | |||
2397 | ahd_lock(ahd, &flags); | 2429 | ahd_lock(ahd, &flags); |
2398 | ahd_set_syncrate(ahd, &devinfo, period, offset, ppr_options, | 2430 | ahd_set_syncrate(ahd, &devinfo, period, offset, ppr_options, |
2399 | AHD_TRANS_GOAL, FALSE); | 2431 | AHD_TRANS_GOAL, FALSE); |
@@ -2415,17 +2447,28 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt) | |||
2415 | unsigned int period = tinfo->goal.period; | 2447 | unsigned int period = tinfo->goal.period; |
2416 | unsigned long flags; | 2448 | unsigned long flags; |
2417 | 2449 | ||
2450 | #ifdef AHD_DEBUG | ||
2451 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2452 | printf("%s: %s DT\n", ahd_name(ahd), | ||
2453 | dt ? "enabling" : "disabling"); | ||
2454 | #endif | ||
2418 | if (dt) { | 2455 | if (dt) { |
2419 | ppr_options |= MSG_EXT_PPR_DT_REQ; | 2456 | ppr_options |= MSG_EXT_PPR_DT_REQ; |
2420 | if (period > 9) | 2457 | if (period > 9) |
2421 | period = 9; /* at least 12.5ns for DT */ | 2458 | period = 9; /* at least 12.5ns for DT */ |
2422 | } else if (period <= 9) | 2459 | } else { |
2423 | period = 10; /* If resetting DT, period must be >= 25ns */ | 2460 | if (period <= 9) |
2424 | 2461 | period = 10; /* If resetting DT, period must be >= 25ns */ | |
2462 | /* IU is invalid without DT set */ | ||
2463 | ppr_options &= ~MSG_EXT_PPR_IU_REQ; | ||
2464 | } | ||
2425 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2465 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2426 | starget->channel + 'A', ROLE_INITIATOR); | 2466 | starget->channel + 'A', ROLE_INITIATOR); |
2427 | ahd_find_syncrate(ahd, &period, &ppr_options, | 2467 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2428 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | 2468 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); |
2469 | |||
2470 | ahd_linux_set_xferflags(starget, ppr_options, period); | ||
2471 | |||
2429 | ahd_lock(ahd, &flags); | 2472 | ahd_lock(ahd, &flags); |
2430 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | 2473 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, |
2431 | ppr_options, AHD_TRANS_GOAL, FALSE); | 2474 | ppr_options, AHD_TRANS_GOAL, FALSE); |
@@ -2445,16 +2488,28 @@ static void ahd_linux_set_qas(struct scsi_target *starget, int qas) | |||
2445 | unsigned int ppr_options = tinfo->goal.ppr_options | 2488 | unsigned int ppr_options = tinfo->goal.ppr_options |
2446 | & ~MSG_EXT_PPR_QAS_REQ; | 2489 | & ~MSG_EXT_PPR_QAS_REQ; |
2447 | unsigned int period = tinfo->goal.period; | 2490 | unsigned int period = tinfo->goal.period; |
2448 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | 2491 | unsigned int dt; |
2449 | unsigned long flags; | 2492 | unsigned long flags; |
2450 | 2493 | ||
2451 | if (qas) | 2494 | #ifdef AHD_DEBUG |
2452 | ppr_options |= MSG_EXT_PPR_QAS_REQ; | 2495 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2496 | printf("%s: %s QAS\n", ahd_name(ahd), | ||
2497 | qas ? "enabling" : "disabling"); | ||
2498 | #endif | ||
2499 | |||
2500 | if (qas) { | ||
2501 | ppr_options |= MSG_EXT_PPR_QAS_REQ; | ||
2502 | } | ||
2503 | |||
2504 | dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2453 | 2505 | ||
2454 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2506 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2455 | starget->channel + 'A', ROLE_INITIATOR); | 2507 | starget->channel + 'A', ROLE_INITIATOR); |
2456 | ahd_find_syncrate(ahd, &period, &ppr_options, | 2508 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2457 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | 2509 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); |
2510 | |||
2511 | spi_qas(starget) = (ppr_options & MSG_EXT_PPR_QAS_REQ)? 1 : 0; | ||
2512 | |||
2458 | ahd_lock(ahd, &flags); | 2513 | ahd_lock(ahd, &flags); |
2459 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | 2514 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, |
2460 | ppr_options, AHD_TRANS_GOAL, FALSE); | 2515 | ppr_options, AHD_TRANS_GOAL, FALSE); |
@@ -2474,16 +2529,29 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu) | |||
2474 | unsigned int ppr_options = tinfo->goal.ppr_options | 2529 | unsigned int ppr_options = tinfo->goal.ppr_options |
2475 | & ~MSG_EXT_PPR_IU_REQ; | 2530 | & ~MSG_EXT_PPR_IU_REQ; |
2476 | unsigned int period = tinfo->goal.period; | 2531 | unsigned int period = tinfo->goal.period; |
2477 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | 2532 | unsigned int dt; |
2478 | unsigned long flags; | 2533 | unsigned long flags; |
2479 | 2534 | ||
2480 | if (iu) | 2535 | #ifdef AHD_DEBUG |
2536 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2537 | printf("%s: %s IU\n", ahd_name(ahd), | ||
2538 | iu ? "enabling" : "disabling"); | ||
2539 | #endif | ||
2540 | |||
2541 | if (iu) { | ||
2481 | ppr_options |= MSG_EXT_PPR_IU_REQ; | 2542 | ppr_options |= MSG_EXT_PPR_IU_REQ; |
2543 | ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */ | ||
2544 | } | ||
2545 | |||
2546 | dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2482 | 2547 | ||
2483 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2548 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2484 | starget->channel + 'A', ROLE_INITIATOR); | 2549 | starget->channel + 'A', ROLE_INITIATOR); |
2485 | ahd_find_syncrate(ahd, &period, &ppr_options, | 2550 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2486 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | 2551 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); |
2552 | |||
2553 | ahd_linux_set_xferflags(starget, ppr_options, period); | ||
2554 | |||
2487 | ahd_lock(ahd, &flags); | 2555 | ahd_lock(ahd, &flags); |
2488 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | 2556 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, |
2489 | ppr_options, AHD_TRANS_GOAL, FALSE); | 2557 | ppr_options, AHD_TRANS_GOAL, FALSE); |
@@ -2506,6 +2574,12 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) | |||
2506 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | 2574 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; |
2507 | unsigned long flags; | 2575 | unsigned long flags; |
2508 | 2576 | ||
2577 | #ifdef AHD_DEBUG | ||
2578 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2579 | printf("%s: %s Read Streaming\n", ahd_name(ahd), | ||
2580 | rdstrm ? "enabling" : "disabling"); | ||
2581 | #endif | ||
2582 | |||
2509 | if (rdstrm) | 2583 | if (rdstrm) |
2510 | ppr_options |= MSG_EXT_PPR_RD_STRM; | 2584 | ppr_options |= MSG_EXT_PPR_RD_STRM; |
2511 | 2585 | ||
@@ -2513,6 +2587,131 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) | |||
2513 | starget->channel + 'A', ROLE_INITIATOR); | 2587 | starget->channel + 'A', ROLE_INITIATOR); |
2514 | ahd_find_syncrate(ahd, &period, &ppr_options, | 2588 | ahd_find_syncrate(ahd, &period, &ppr_options, |
2515 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | 2589 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); |
2590 | |||
2591 | spi_rd_strm(starget) = (ppr_options & MSG_EXT_PPR_RD_STRM) ? 1 : 0; | ||
2592 | |||
2593 | ahd_lock(ahd, &flags); | ||
2594 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | ||
2595 | ppr_options, AHD_TRANS_GOAL, FALSE); | ||
2596 | ahd_unlock(ahd, &flags); | ||
2597 | } | ||
2598 | |||
2599 | static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow) | ||
2600 | { | ||
2601 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | ||
2602 | struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata); | ||
2603 | struct ahd_tmode_tstate *tstate; | ||
2604 | struct ahd_initiator_tinfo *tinfo | ||
2605 | = ahd_fetch_transinfo(ahd, | ||
2606 | starget->channel + 'A', | ||
2607 | shost->this_id, starget->id, &tstate); | ||
2608 | struct ahd_devinfo devinfo; | ||
2609 | unsigned int ppr_options = tinfo->goal.ppr_options | ||
2610 | & ~MSG_EXT_PPR_WR_FLOW; | ||
2611 | unsigned int period = tinfo->goal.period; | ||
2612 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2613 | unsigned long flags; | ||
2614 | |||
2615 | #ifdef AHD_DEBUG | ||
2616 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2617 | printf("%s: %s Write Flow Control\n", ahd_name(ahd), | ||
2618 | wrflow ? "enabling" : "disabling"); | ||
2619 | #endif | ||
2620 | |||
2621 | if (wrflow) | ||
2622 | ppr_options |= MSG_EXT_PPR_WR_FLOW; | ||
2623 | |||
2624 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | ||
2625 | starget->channel + 'A', ROLE_INITIATOR); | ||
2626 | ahd_find_syncrate(ahd, &period, &ppr_options, | ||
2627 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | ||
2628 | |||
2629 | spi_wr_flow(starget) = (ppr_options & MSG_EXT_PPR_WR_FLOW) ? 1 : 0; | ||
2630 | |||
2631 | ahd_lock(ahd, &flags); | ||
2632 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | ||
2633 | ppr_options, AHD_TRANS_GOAL, FALSE); | ||
2634 | ahd_unlock(ahd, &flags); | ||
2635 | } | ||
2636 | |||
2637 | static void ahd_linux_set_rti(struct scsi_target *starget, int rti) | ||
2638 | { | ||
2639 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | ||
2640 | struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata); | ||
2641 | struct ahd_tmode_tstate *tstate; | ||
2642 | struct ahd_initiator_tinfo *tinfo | ||
2643 | = ahd_fetch_transinfo(ahd, | ||
2644 | starget->channel + 'A', | ||
2645 | shost->this_id, starget->id, &tstate); | ||
2646 | struct ahd_devinfo devinfo; | ||
2647 | unsigned int ppr_options = tinfo->goal.ppr_options | ||
2648 | & ~MSG_EXT_PPR_RTI; | ||
2649 | unsigned int period = tinfo->goal.period; | ||
2650 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2651 | unsigned long flags; | ||
2652 | |||
2653 | if ((ahd->features & AHD_RTI) == 0) { | ||
2654 | #ifdef AHD_DEBUG | ||
2655 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2656 | printf("%s: RTI not available\n", ahd_name(ahd)); | ||
2657 | #endif | ||
2658 | return; | ||
2659 | } | ||
2660 | |||
2661 | #ifdef AHD_DEBUG | ||
2662 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2663 | printf("%s: %s RTI\n", ahd_name(ahd), | ||
2664 | rti ? "enabling" : "disabling"); | ||
2665 | #endif | ||
2666 | |||
2667 | if (rti) | ||
2668 | ppr_options |= MSG_EXT_PPR_RTI; | ||
2669 | |||
2670 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | ||
2671 | starget->channel + 'A', ROLE_INITIATOR); | ||
2672 | ahd_find_syncrate(ahd, &period, &ppr_options, | ||
2673 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | ||
2674 | |||
2675 | spi_rti(starget) = (ppr_options & MSG_EXT_PPR_RTI) ? 1 : 0; | ||
2676 | |||
2677 | ahd_lock(ahd, &flags); | ||
2678 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | ||
2679 | ppr_options, AHD_TRANS_GOAL, FALSE); | ||
2680 | ahd_unlock(ahd, &flags); | ||
2681 | } | ||
2682 | |||
2683 | static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp) | ||
2684 | { | ||
2685 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | ||
2686 | struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata); | ||
2687 | struct ahd_tmode_tstate *tstate; | ||
2688 | struct ahd_initiator_tinfo *tinfo | ||
2689 | = ahd_fetch_transinfo(ahd, | ||
2690 | starget->channel + 'A', | ||
2691 | shost->this_id, starget->id, &tstate); | ||
2692 | struct ahd_devinfo devinfo; | ||
2693 | unsigned int ppr_options = tinfo->goal.ppr_options | ||
2694 | & ~MSG_EXT_PPR_PCOMP_EN; | ||
2695 | unsigned int period = tinfo->goal.period; | ||
2696 | unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; | ||
2697 | unsigned long flags; | ||
2698 | |||
2699 | #ifdef AHD_DEBUG | ||
2700 | if ((ahd_debug & AHD_SHOW_DV) != 0) | ||
2701 | printf("%s: %s Precompensation\n", ahd_name(ahd), | ||
2702 | pcomp ? "Enable" : "Disable"); | ||
2703 | #endif | ||
2704 | |||
2705 | if (pcomp) | ||
2706 | ppr_options |= MSG_EXT_PPR_PCOMP_EN; | ||
2707 | |||
2708 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | ||
2709 | starget->channel + 'A', ROLE_INITIATOR); | ||
2710 | ahd_find_syncrate(ahd, &period, &ppr_options, | ||
2711 | dt ? AHD_SYNCRATE_MAX : AHD_SYNCRATE_ULTRA2); | ||
2712 | |||
2713 | spi_pcomp_en(starget) = (ppr_options & MSG_EXT_PPR_PCOMP_EN) ? 1 : 0; | ||
2714 | |||
2516 | ahd_lock(ahd, &flags); | 2715 | ahd_lock(ahd, &flags); |
2517 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, | 2716 | ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset, |
2518 | ppr_options, AHD_TRANS_GOAL, FALSE); | 2717 | ppr_options, AHD_TRANS_GOAL, FALSE); |
@@ -2534,6 +2733,12 @@ static struct spi_function_template ahd_linux_transport_functions = { | |||
2534 | .show_qas = 1, | 2733 | .show_qas = 1, |
2535 | .set_rd_strm = ahd_linux_set_rd_strm, | 2734 | .set_rd_strm = ahd_linux_set_rd_strm, |
2536 | .show_rd_strm = 1, | 2735 | .show_rd_strm = 1, |
2736 | .set_wr_flow = ahd_linux_set_wr_flow, | ||
2737 | .show_wr_flow = 1, | ||
2738 | .set_rti = ahd_linux_set_rti, | ||
2739 | .show_rti = 1, | ||
2740 | .set_pcomp_en = ahd_linux_set_pcomp_en, | ||
2741 | .show_pcomp_en = 1, | ||
2537 | }; | 2742 | }; |
2538 | 2743 | ||
2539 | 2744 | ||