]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: aic7xxx: Fix build using bare-metal toolchain
authorSam Protsenko <semen.protsenko@linaro.org>
Wed, 29 Aug 2018 17:00:15 +0000 (20:00 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 30 Aug 2018 11:41:09 +0000 (07:41 -0400)
Bare-metal toolchains don't define __linux__, so aic7xxx build with
bare-metal toolchain is broken. This driver codebase used to be partially
shared with FreeBSD, but these days there is no point in keeping the
compatibility around. So let's just drop FreeBSD related code and get rid
of __linux__ checking in order to fix the build using bare-metal
toolchains.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
15 files changed:
drivers/scsi/aic7xxx/aic7770.c
drivers/scsi/aic7xxx/aic79xx.h
drivers/scsi/aic7xxx/aic79xx_core.c
drivers/scsi/aic7xxx/aic79xx_pci.c
drivers/scsi/aic7xxx/aic7xxx.h
drivers/scsi/aic7xxx/aic7xxx_93cx6.c
drivers/scsi/aic7xxx/aic7xxx_core.c
drivers/scsi/aic7xxx/aic7xxx_pci.c
drivers/scsi/aic7xxx/aicasm/aicasm.h
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h

index 5000bd69c13f0c344f83548ea9e23802a41393bf..176704b24e6abec195053e48af64a849e9062858 100644 (file)
  * $FreeBSD$
  */
 
-#ifdef __linux__
 #include "aic7xxx_osm.h"
 #include "aic7xxx_inline.h"
 #include "aic7xxx_93cx6.h"
-#else
-#include <dev/aic7xxx/aic7xxx_osm.h>
-#include <dev/aic7xxx/aic7xxx_inline.h>
-#include <dev/aic7xxx/aic7xxx_93cx6.h>
-#endif
 
 #define ID_AIC7770     0x04907770
 #define ID_AHA_274x    0x04907771
index 31f2bb9d71461900bec98a3049ed7495b4ba53d9..9a515551641cbaad5d52f9500feebc0849d77641 100644 (file)
@@ -607,9 +607,6 @@ struct scb {
        ahd_io_ctx_t              io_ctx;
        struct ahd_softc         *ahd_softc;
        scb_flag                  flags;
-#ifndef __linux__
-       bus_dmamap_t              dmamap;
-#endif
        struct scb_platform_data *platform_data;
        struct map_node          *hscb_map;
        struct map_node          *sg_map;
@@ -1056,9 +1053,6 @@ struct ahd_completion
 struct ahd_softc {
        bus_space_tag_t           tags[2];
        bus_space_handle_t        bshs[2];
-#ifndef __linux__
-       bus_dma_tag_t             buffer_dmat;   /* dmat for buffer I/O */
-#endif
        struct scb_data           scb_data;
 
        struct hardware_scb      *next_queued_hscb;
index 2d82ec85753efc9628cbdf5faa7e1699e64113cb..8e57a1dacb6a41a2a9bdcfc3071c1115b2ac7cb4 100644 (file)
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#250 $
  */
 
-#ifdef __linux__
 #include "aic79xx_osm.h"
 #include "aic79xx_inline.h"
 #include "aicasm/aicasm_insformat.h"
-#else
-#include <dev/aic7xxx/aic79xx_osm.h>
-#include <dev/aic7xxx/aic79xx_inline.h>
-#include <dev/aic7xxx/aicasm/aicasm_insformat.h>
-#endif
-
 
 /***************************** Lookup Tables **********************************/
 static const char *const ahd_chip_names[] =
@@ -6172,17 +6165,11 @@ ahd_free(struct ahd_softc *ahd)
        case 2:
                ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat);
        case 1:
-#ifndef __linux__
-               ahd_dma_tag_destroy(ahd, ahd->buffer_dmat);
-#endif
                break;
        case 0:
                break;
        }
 
-#ifndef __linux__
-       ahd_dma_tag_destroy(ahd, ahd->parent_dmat);
-#endif
        ahd_platform_free(ahd);
        ahd_fini_scbdata(ahd);
        for (i = 0; i < AHD_NUM_TARGETS; i++) {
@@ -6934,9 +6921,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
        for (i = 0; i < newcount; i++) {
                struct scb_platform_data *pdata;
                u_int col_tag;
-#ifndef __linux__
-               int error;
-#endif
 
                next_scb = kmalloc(sizeof(*next_scb), GFP_ATOMIC);
                if (next_scb == NULL)
@@ -6970,15 +6954,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
                        next_scb->sg_list_busaddr += sizeof(struct ahd_dma_seg);
                next_scb->ahd_softc = ahd;
                next_scb->flags = SCB_FLAG_NONE;
-#ifndef __linux__
-               error = ahd_dmamap_create(ahd, ahd->buffer_dmat, /*flags*/0,
-                                         &next_scb->dmamap);
-               if (error != 0) {
-                       kfree(next_scb);
-                       kfree(pdata);
-                       break;
-               }
-#endif
                next_scb->hscb->tag = ahd_htole16(scb_data->numscbs);
                col_tag = scb_data->numscbs ^ 0x100;
                next_scb->col_scb = ahd_find_scb_by_tag(ahd, col_tag);
@@ -7091,24 +7066,6 @@ ahd_init(struct ahd_softc *ahd)
        if ((AHD_TMODE_ENABLE & (0x1 << ahd->unit)) == 0)
                ahd->features &= ~AHD_TARGETMODE;
 
-#ifndef __linux__
-       /* DMA tag for mapping buffers into device visible space. */
-       if (ahd_dma_tag_create(ahd, ahd->parent_dmat, /*alignment*/1,
-                              /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1,
-                              /*lowaddr*/ahd->flags & AHD_39BIT_ADDRESSING
-                                       ? (dma_addr_t)0x7FFFFFFFFFULL
-                                       : BUS_SPACE_MAXADDR_32BIT,
-                              /*highaddr*/BUS_SPACE_MAXADDR,
-                              /*filter*/NULL, /*filterarg*/NULL,
-                              /*maxsize*/(AHD_NSEG - 1) * PAGE_SIZE,
-                              /*nsegments*/AHD_NSEG,
-                              /*maxsegsz*/AHD_MAXTRANSFER_SIZE,
-                              /*flags*/BUS_DMA_ALLOCNOW,
-                              &ahd->buffer_dmat) != 0) {
-               return (ENOMEM);
-       }
-#endif
-
        ahd->init_level++;
 
        /*
index cc9bd26f5d1abc01e92c30baadb1adfed1e84b85..c68943b22e89b951aa299ee36f9c3c6360daa201 100644 (file)
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $
  */
 
-#ifdef __linux__
 #include "aic79xx_osm.h"
 #include "aic79xx_inline.h"
-#else
-#include <dev/aic7xxx/aic79xx_osm.h>
-#include <dev/aic7xxx/aic79xx_inline.h>
-#endif
-
 #include "aic79xx_pci.h"
 
 static inline uint64_t
index 4ce4e903a759e9eab6c84a6ee2dbf0c29c97f4b1..5614921b4041acf4a10c004646d93fa1aa0ebff6 100644 (file)
@@ -568,9 +568,6 @@ struct scb {
        ahc_io_ctx_t              io_ctx;
        struct ahc_softc         *ahc_softc;
        scb_flag                  flags;
-#ifndef __linux__
-       bus_dmamap_t              dmamap;
-#endif
        struct scb_platform_data *platform_data;
        struct sg_map_node       *sg_map;
        struct ahc_dma_seg       *sg_list;
@@ -906,9 +903,6 @@ typedef void ahc_callback_t (void *);
 struct ahc_softc {
        bus_space_tag_t           tag;
        bus_space_handle_t        bsh;
-#ifndef __linux__
-       bus_dma_tag_t             buffer_dmat;   /* dmat for buffer I/O */
-#endif
        struct scb_data          *scb_data;
 
        struct scb               *next_queued_scb;
index 9e85a7ef9c8e6f1a6bf8b7d8d27cab34a2dd8929..cc9e41967ce42e373760d7eda919b86b2b056d43 100644 (file)
  *   bit to be sent from the chip.
  */
 
-#ifdef __linux__
 #include "aic7xxx_osm.h"
 #include "aic7xxx_inline.h"
 #include "aic7xxx_93cx6.h"
-#else
-#include <dev/aic7xxx/aic7xxx_osm.h>
-#include <dev/aic7xxx/aic7xxx_inline.h>
-#include <dev/aic7xxx/aic7xxx_93cx6.h>
-#endif
 
 /*
  * Right now, we only have to read the SEEPROM.  But we make it easier to
index 915a34f141e4f66503133af8453521de0ffb3783..aa4eaa4fa23ace4e174e8db48367e6c824cef53d 100644 (file)
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $
  */
 
-#ifdef __linux__
 #include "aic7xxx_osm.h"
 #include "aic7xxx_inline.h"
 #include "aicasm/aicasm_insformat.h"
-#else
-#include <dev/aic7xxx/aic7xxx_osm.h>
-#include <dev/aic7xxx/aic7xxx_inline.h>
-#include <dev/aic7xxx/aicasm/aicasm_insformat.h>
-#endif
 
 /***************************** Lookup Tables **********************************/
 static const char *const ahc_chip_names[] = {
@@ -4509,17 +4503,11 @@ ahc_free(struct ahc_softc *ahc)
        case 2:
                ahc_dma_tag_destroy(ahc, ahc->shared_data_dmat);
        case 1:
-#ifndef __linux__
-               ahc_dma_tag_destroy(ahc, ahc->buffer_dmat);
-#endif
                break;
        case 0:
                break;
        }
 
-#ifndef __linux__
-       ahc_dma_tag_destroy(ahc, ahc->parent_dmat);
-#endif
        ahc_platform_free(ahc);
        ahc_fini_scbdata(ahc);
        for (i = 0; i < AHC_NUM_TARGETS; i++) {
@@ -5005,9 +4993,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
        newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
        for (i = 0; i < newcount; i++) {
                struct scb_platform_data *pdata;
-#ifndef __linux__
-               int error;
-#endif
+
                pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC);
                if (pdata == NULL)
                        break;
@@ -5021,12 +5007,6 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
                next_scb->sg_list_phys = physaddr + sizeof(struct ahc_dma_seg);
                next_scb->ahc_softc = ahc;
                next_scb->flags = SCB_FREE;
-#ifndef __linux__
-               error = ahc_dmamap_create(ahc, ahc->buffer_dmat, /*flags*/0,
-                                         &next_scb->dmamap);
-               if (error != 0)
-                       break;
-#endif
                next_scb->hscb = &scb_data->hscbs[scb_data->numscbs];
                next_scb->hscb->tag = ahc->scb_data->numscbs;
                SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs,
@@ -5325,24 +5305,6 @@ ahc_init(struct ahc_softc *ahc)
        if ((AHC_TMODE_ENABLE & (0x1 << ahc->unit)) == 0)
                ahc->features &= ~AHC_TARGETMODE;
 
-#ifndef __linux__
-       /* DMA tag for mapping buffers into device visible space. */
-       if (ahc_dma_tag_create(ahc, ahc->parent_dmat, /*alignment*/1,
-                              /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1,
-                              /*lowaddr*/ahc->flags & AHC_39BIT_ADDRESSING
-                                       ? (dma_addr_t)0x7FFFFFFFFFULL
-                                       : BUS_SPACE_MAXADDR_32BIT,
-                              /*highaddr*/BUS_SPACE_MAXADDR,
-                              /*filter*/NULL, /*filterarg*/NULL,
-                              /*maxsize*/(AHC_NSEG - 1) * PAGE_SIZE,
-                              /*nsegments*/AHC_NSEG,
-                              /*maxsegsz*/AHC_MAXTRANSFER_SIZE,
-                              /*flags*/BUS_DMA_ALLOCNOW,
-                              &ahc->buffer_dmat) != 0) {
-               return (ENOMEM);
-       }
-#endif
-
        ahc->init_level++;
 
        /*
index 673e826d7adbad67763d421f3c96ac93a00c20af..656f680c78024d7cd64a357b7056ba538d89262c 100644 (file)
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $
  */
 
-#ifdef __linux__
 #include "aic7xxx_osm.h"
 #include "aic7xxx_inline.h"
 #include "aic7xxx_93cx6.h"
-#else
-#include <dev/aic7xxx/aic7xxx_osm.h>
-#include <dev/aic7xxx/aic7xxx_inline.h>
-#include <dev/aic7xxx/aic7xxx_93cx6.h>
-#endif
-
 #include "aic7xxx_pci.h"
 
 static inline uint64_t
index 51678dd46ff74662677cee6ba7f75e7155df8477..716a2aefc925f4c2330a5028098bf7789af170d8 100644 (file)
  * $FreeBSD$
  */
 
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 #ifndef TRUE
 #define TRUE 1
index f1586a437906753ae8fd008c7869e239b8c3459f..924d55a8acbfced66e23f8851f182b8e2c3c7439 100644 (file)
 #include <string.h>
 #include <sysexits.h>
 
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 #include "aicasm.h"
 #include "aicasm_symbol.h"
index 708326df076623f698b96fbc9b8741300b8c69b2..8c0479865f046e33c1dd5db1c57b3734dfe9e4d9 100644 (file)
 #include <string.h>
 #include <sysexits.h>
 
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 #include "aicasm.h"
 #include "aicasm_symbol.h"
index c0457b8c3b77365a5cedc3d6d74f90647faf09ef..98e9959c690798093a711064b9b0708a1af96ff6 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <sysexits.h>
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 #include "aicasm.h"
 #include "aicasm_symbol.h"
index 93c8667cd704dd0af10d85a32e2806422ccecfce..c78d4f68eea520556937ffe3876e8599ab4a47dd 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <sysexits.h>
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 #include "aicasm.h"
 #include "aicasm_symbol.h"
index 232aff1fe784ec70b8d1ead0b9be1711443ecb97..975fcfcc0d8f665557aaea7393a04b009bea74bc 100644 (file)
 
 #include <sys/types.h>
 
-#ifdef __linux__
 #include "aicdb.h"
-#else
-#include <db.h>
-#endif
 #include <fcntl.h>
 #include <inttypes.h>
 #include <regex.h>
index 34bbcad7f83fff71ca5ebe4ad28a07432a7424a0..7bf7fd5953ac97aeb767fa87249abed6e246d975 100644 (file)
  * $FreeBSD$
  */
 
-#ifdef __linux__
 #include "../queue.h"
-#else
-#include <sys/queue.h>
-#endif
 
 typedef enum {
        UNINITIALIZED,