--- zzzz-none-000/linux-2.6.19.2/drivers/scsi/aic7xxx/aic7xxx_core.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/drivers/scsi/aic7xxx/aic7xxx_core.c 2007-01-11 07:38:19.000000000 +0000 @@ -1671,7 +1671,7 @@ transinfo = &tinfo->goal; *ppr_options &= transinfo->ppr_options; if (transinfo->width == MSG_EXT_WDTR_BUS_8_BIT) { - maxsync = max(maxsync, (u_int)AHC_SYNCRATE_ULTRA2); + maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2); *ppr_options &= ~MSG_EXT_PPR_DT_REQ; } if (transinfo->period == 0) { @@ -1679,7 +1679,7 @@ *ppr_options = 0; return (NULL); } - *period = max(*period, (u_int)transinfo->period); + *period = MAX(*period, transinfo->period); return (ahc_find_syncrate(ahc, period, ppr_options, maxsync)); } @@ -1804,12 +1804,12 @@ else maxoffset = MAX_OFFSET_8BIT; } - *offset = min(*offset, maxoffset); + *offset = MIN(*offset, maxoffset); if (tinfo != NULL) { if (role == ROLE_TARGET) - *offset = min(*offset, (u_int)tinfo->user.offset); + *offset = MIN(*offset, tinfo->user.offset); else - *offset = min(*offset, (u_int)tinfo->goal.offset); + *offset = MIN(*offset, tinfo->goal.offset); } } @@ -1835,9 +1835,9 @@ } if (tinfo != NULL) { if (role == ROLE_TARGET) - *bus_width = min((u_int)tinfo->user.width, *bus_width); + *bus_width = MIN(tinfo->user.width, *bus_width); else - *bus_width = min((u_int)tinfo->goal.width, *bus_width); + *bus_width = MIN(tinfo->goal.width, *bus_width); } } @@ -1986,7 +1986,7 @@ tinfo->curr.ppr_options = ppr_options; ahc_send_async(ahc, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_TRANSFER_NEG); + CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); if (bootverbose) { if (offset != 0) { printf("%s: target %d synchronous at %sMHz%s, " @@ -2056,7 +2056,7 @@ tinfo->curr.width = width; ahc_send_async(ahc, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_TRANSFER_NEG); + CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); if (bootverbose) { printf("%s: target %d using %dbit transfers\n", ahc_name(ahc), devinfo->target, @@ -2074,14 +2074,12 @@ * Update the current state of tagged queuing for a given target. */ void -ahc_set_tags(struct ahc_softc *ahc, struct scsi_cmnd *cmd, - struct ahc_devinfo *devinfo, ahc_queue_alg alg) +ahc_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, + ahc_queue_alg alg) { - struct scsi_device *sdev = cmd->device; - - ahc_platform_set_tags(ahc, sdev, devinfo, alg); + ahc_platform_set_tags(ahc, devinfo, alg); ahc_send_async(ahc, devinfo->channel, devinfo->target, - devinfo->lun, AC_TRANSFER_NEG); + devinfo->lun, AC_TRANSFER_NEG, &alg); } /* @@ -3491,7 +3489,7 @@ printf("(%s:%c:%d:%d): refuses tagged commands. " "Performing non-tagged I/O\n", ahc_name(ahc), devinfo->channel, devinfo->target, devinfo->lun); - ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE); + ahc_set_tags(ahc, devinfo, AHC_QUEUE_NONE); mask = ~0x23; } else { printf("(%s:%c:%d:%d): refuses %s tagged commands. " @@ -3499,7 +3497,7 @@ ahc_name(ahc), devinfo->channel, devinfo->target, devinfo->lun, tag_type == MSG_ORDERED_TASK ? "ordered" : "head of queue"); - ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_BASIC); + ahc_set_tags(ahc, devinfo, AHC_QUEUE_BASIC); mask = ~0x03; } @@ -3765,7 +3763,7 @@ if (status != CAM_SEL_TIMEOUT) ahc_send_async(ahc, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_SENT_BDR); + CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); if (message != NULL && (verbose_level <= bootverbose)) @@ -4408,7 +4406,7 @@ physaddr = sg_map->sg_physaddr; newcount = (PAGE_SIZE / (AHC_NSEG * sizeof(struct ahc_dma_seg))); - newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs)); + newcount = MIN(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs)); for (i = 0; i < newcount; i++) { struct scb_platform_data *pdata; #ifndef __linux__ @@ -6020,7 +6018,7 @@ #endif /* Notify the XPT that a bus reset occurred */ ahc_send_async(ahc, devinfo.channel, CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD, AC_BUS_RESET); + CAM_LUN_WILDCARD, AC_BUS_RESET, NULL); /* * Revert to async/narrow transfers until we renegotiate. @@ -6444,7 +6442,7 @@ if (skip_addr > i) { int end_addr; - end_addr = min(address, skip_addr); + end_addr = MIN(address, skip_addr); address_offset += end_addr - i; i = skip_addr; } else {