Deleted Added
sdiff udiff text old ( 199178 ) new ( 199747 )
full compact
1/*-
2 * Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/cam/ata/ata_all.c 199178 2009-11-11 11:10:36Z mav $");
29
30#include <sys/param.h>
31
32#ifdef _KERNEL
33#include <opt_scsi.h>
34
35#include <sys/systm.h>
36#include <sys/libkern.h>

--- 449 unchanged lines hidden (view full) ---

486 return ATA_UDMA1;
487 if (ap->udmamodes & 0x01)
488 return ATA_UDMA0;
489 }
490 return -1;
491}
492
493int
494ata_max_mode(struct ata_params *ap, int mode, int maxmode)
495{
496
497 if (maxmode && mode > maxmode)
498 mode = maxmode;
499
500 if (mode >= ATA_UDMA0 && ata_max_umode(ap) > 0)
501 return (min(mode, ata_max_umode(ap)));
502
503 if (mode >= ATA_WDMA0 && ata_max_wmode(ap) > 0)
504 return (min(mode, ata_max_wmode(ap)));
505
506 if (mode > ata_max_pmode(ap))
507 return (min(mode, ata_max_pmode(ap)));
508
509 return (mode);
510}
511
512int
513ata_identify_match(caddr_t identbuffer, caddr_t table_entry)
514{
515 struct scsi_inquiry_pattern *entry;
516 struct ata_params *ident;
517

--- 29 unchanged lines hidden ---