Commit cca6cb8a authored by Sam Protsenko's avatar Sam Protsenko Committed by Martin K. Petersen

scsi: aic7xxx: Fix build using bare-metal toolchain

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: default avatarSam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b6876a84
...@@ -42,15 +42,9 @@ ...@@ -42,15 +42,9 @@
* $FreeBSD$ * $FreeBSD$
*/ */
#ifdef __linux__
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
#include "aic7xxx_inline.h" #include "aic7xxx_inline.h"
#include "aic7xxx_93cx6.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_AIC7770 0x04907770
#define ID_AHA_274x 0x04907771 #define ID_AHA_274x 0x04907771
......
...@@ -607,9 +607,6 @@ struct scb { ...@@ -607,9 +607,6 @@ struct scb {
ahd_io_ctx_t io_ctx; ahd_io_ctx_t io_ctx;
struct ahd_softc *ahd_softc; struct ahd_softc *ahd_softc;
scb_flag flags; scb_flag flags;
#ifndef __linux__
bus_dmamap_t dmamap;
#endif
struct scb_platform_data *platform_data; struct scb_platform_data *platform_data;
struct map_node *hscb_map; struct map_node *hscb_map;
struct map_node *sg_map; struct map_node *sg_map;
...@@ -1056,9 +1053,6 @@ struct ahd_completion ...@@ -1056,9 +1053,6 @@ struct ahd_completion
struct ahd_softc { struct ahd_softc {
bus_space_tag_t tags[2]; bus_space_tag_t tags[2];
bus_space_handle_t bshs[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 scb_data scb_data;
struct hardware_scb *next_queued_hscb; struct hardware_scb *next_queued_hscb;
......
...@@ -40,16 +40,9 @@ ...@@ -40,16 +40,9 @@
* $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#250 $ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#250 $
*/ */
#ifdef __linux__
#include "aic79xx_osm.h" #include "aic79xx_osm.h"
#include "aic79xx_inline.h" #include "aic79xx_inline.h"
#include "aicasm/aicasm_insformat.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 **********************************/ /***************************** Lookup Tables **********************************/
static const char *const ahd_chip_names[] = static const char *const ahd_chip_names[] =
...@@ -6172,17 +6165,11 @@ ahd_free(struct ahd_softc *ahd) ...@@ -6172,17 +6165,11 @@ ahd_free(struct ahd_softc *ahd)
case 2: case 2:
ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat);
case 1: case 1:
#ifndef __linux__
ahd_dma_tag_destroy(ahd, ahd->buffer_dmat);
#endif
break; break;
case 0: case 0:
break; break;
} }
#ifndef __linux__
ahd_dma_tag_destroy(ahd, ahd->parent_dmat);
#endif
ahd_platform_free(ahd); ahd_platform_free(ahd);
ahd_fini_scbdata(ahd); ahd_fini_scbdata(ahd);
for (i = 0; i < AHD_NUM_TARGETS; i++) { for (i = 0; i < AHD_NUM_TARGETS; i++) {
...@@ -6934,9 +6921,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd) ...@@ -6934,9 +6921,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
for (i = 0; i < newcount; i++) { for (i = 0; i < newcount; i++) {
struct scb_platform_data *pdata; struct scb_platform_data *pdata;
u_int col_tag; u_int col_tag;
#ifndef __linux__
int error;
#endif
next_scb = kmalloc(sizeof(*next_scb), GFP_ATOMIC); next_scb = kmalloc(sizeof(*next_scb), GFP_ATOMIC);
if (next_scb == NULL) if (next_scb == NULL)
...@@ -6970,15 +6954,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd) ...@@ -6970,15 +6954,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
next_scb->sg_list_busaddr += sizeof(struct ahd_dma_seg); next_scb->sg_list_busaddr += sizeof(struct ahd_dma_seg);
next_scb->ahd_softc = ahd; next_scb->ahd_softc = ahd;
next_scb->flags = SCB_FLAG_NONE; 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); next_scb->hscb->tag = ahd_htole16(scb_data->numscbs);
col_tag = scb_data->numscbs ^ 0x100; col_tag = scb_data->numscbs ^ 0x100;
next_scb->col_scb = ahd_find_scb_by_tag(ahd, col_tag); next_scb->col_scb = ahd_find_scb_by_tag(ahd, col_tag);
...@@ -7091,24 +7066,6 @@ ahd_init(struct ahd_softc *ahd) ...@@ -7091,24 +7066,6 @@ ahd_init(struct ahd_softc *ahd)
if ((AHD_TMODE_ENABLE & (0x1 << ahd->unit)) == 0) if ((AHD_TMODE_ENABLE & (0x1 << ahd->unit)) == 0)
ahd->features &= ~AHD_TARGETMODE; 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++; ahd->init_level++;
/* /*
......
...@@ -41,14 +41,8 @@ ...@@ -41,14 +41,8 @@
* $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $
*/ */
#ifdef __linux__
#include "aic79xx_osm.h" #include "aic79xx_osm.h"
#include "aic79xx_inline.h" #include "aic79xx_inline.h"
#else
#include <dev/aic7xxx/aic79xx_osm.h>
#include <dev/aic7xxx/aic79xx_inline.h>
#endif
#include "aic79xx_pci.h" #include "aic79xx_pci.h"
static inline uint64_t static inline uint64_t
......
...@@ -568,9 +568,6 @@ struct scb { ...@@ -568,9 +568,6 @@ struct scb {
ahc_io_ctx_t io_ctx; ahc_io_ctx_t io_ctx;
struct ahc_softc *ahc_softc; struct ahc_softc *ahc_softc;
scb_flag flags; scb_flag flags;
#ifndef __linux__
bus_dmamap_t dmamap;
#endif
struct scb_platform_data *platform_data; struct scb_platform_data *platform_data;
struct sg_map_node *sg_map; struct sg_map_node *sg_map;
struct ahc_dma_seg *sg_list; struct ahc_dma_seg *sg_list;
...@@ -906,9 +903,6 @@ typedef void ahc_callback_t (void *); ...@@ -906,9 +903,6 @@ typedef void ahc_callback_t (void *);
struct ahc_softc { struct ahc_softc {
bus_space_tag_t tag; bus_space_tag_t tag;
bus_space_handle_t bsh; 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_data *scb_data;
struct scb *next_queued_scb; struct scb *next_queued_scb;
......
...@@ -64,15 +64,9 @@ ...@@ -64,15 +64,9 @@
* bit to be sent from the chip. * bit to be sent from the chip.
*/ */
#ifdef __linux__
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
#include "aic7xxx_inline.h" #include "aic7xxx_inline.h"
#include "aic7xxx_93cx6.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 * Right now, we only have to read the SEEPROM. But we make it easier to
......
...@@ -40,15 +40,9 @@ ...@@ -40,15 +40,9 @@
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $
*/ */
#ifdef __linux__
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
#include "aic7xxx_inline.h" #include "aic7xxx_inline.h"
#include "aicasm/aicasm_insformat.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 **********************************/ /***************************** Lookup Tables **********************************/
static const char *const ahc_chip_names[] = { static const char *const ahc_chip_names[] = {
...@@ -4509,17 +4503,11 @@ ahc_free(struct ahc_softc *ahc) ...@@ -4509,17 +4503,11 @@ ahc_free(struct ahc_softc *ahc)
case 2: case 2:
ahc_dma_tag_destroy(ahc, ahc->shared_data_dmat); ahc_dma_tag_destroy(ahc, ahc->shared_data_dmat);
case 1: case 1:
#ifndef __linux__
ahc_dma_tag_destroy(ahc, ahc->buffer_dmat);
#endif
break; break;
case 0: case 0:
break; break;
} }
#ifndef __linux__
ahc_dma_tag_destroy(ahc, ahc->parent_dmat);
#endif
ahc_platform_free(ahc); ahc_platform_free(ahc);
ahc_fini_scbdata(ahc); ahc_fini_scbdata(ahc);
for (i = 0; i < AHC_NUM_TARGETS; i++) { for (i = 0; i < AHC_NUM_TARGETS; i++) {
...@@ -5005,9 +4993,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) ...@@ -5005,9 +4993,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
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++) { for (i = 0; i < newcount; i++) {
struct scb_platform_data *pdata; struct scb_platform_data *pdata;
#ifndef __linux__
int error;
#endif
pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC);
if (pdata == NULL) if (pdata == NULL)
break; break;
...@@ -5021,12 +5007,6 @@ ahc_alloc_scbs(struct ahc_softc *ahc) ...@@ -5021,12 +5007,6 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
next_scb->sg_list_phys = physaddr + sizeof(struct ahc_dma_seg); next_scb->sg_list_phys = physaddr + sizeof(struct ahc_dma_seg);
next_scb->ahc_softc = ahc; next_scb->ahc_softc = ahc;
next_scb->flags = SCB_FREE; 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 = &scb_data->hscbs[scb_data->numscbs];
next_scb->hscb->tag = ahc->scb_data->numscbs; next_scb->hscb->tag = ahc->scb_data->numscbs;
SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs,
...@@ -5325,24 +5305,6 @@ ahc_init(struct ahc_softc *ahc) ...@@ -5325,24 +5305,6 @@ ahc_init(struct ahc_softc *ahc)
if ((AHC_TMODE_ENABLE & (0x1 << ahc->unit)) == 0) if ((AHC_TMODE_ENABLE & (0x1 << ahc->unit)) == 0)
ahc->features &= ~AHC_TARGETMODE; 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++; ahc->init_level++;
/* /*
......
...@@ -42,16 +42,9 @@ ...@@ -42,16 +42,9 @@
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $
*/ */
#ifdef __linux__
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
#include "aic7xxx_inline.h" #include "aic7xxx_inline.h"
#include "aic7xxx_93cx6.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" #include "aic7xxx_pci.h"
static inline uint64_t static inline uint64_t
......
...@@ -42,11 +42,7 @@ ...@@ -42,11 +42,7 @@
* $FreeBSD$ * $FreeBSD$
*/ */
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
......
...@@ -52,11 +52,7 @@ ...@@ -52,11 +52,7 @@
#include <string.h> #include <string.h>
#include <sysexits.h> #include <sysexits.h>
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
#include "aicasm.h" #include "aicasm.h"
#include "aicasm_symbol.h" #include "aicasm_symbol.h"
......
...@@ -52,11 +52,7 @@ ...@@ -52,11 +52,7 @@
#include <string.h> #include <string.h>
#include <sysexits.h> #include <sysexits.h>
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
#include "aicasm.h" #include "aicasm.h"
#include "aicasm_symbol.h" #include "aicasm_symbol.h"
......
...@@ -51,11 +51,7 @@ ...@@ -51,11 +51,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sysexits.h> #include <sysexits.h>
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
#include "aicasm.h" #include "aicasm.h"
#include "aicasm_symbol.h" #include "aicasm_symbol.h"
......
...@@ -51,11 +51,7 @@ ...@@ -51,11 +51,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sysexits.h> #include <sysexits.h>
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
#include "aicasm.h" #include "aicasm.h"
#include "aicasm_symbol.h" #include "aicasm_symbol.h"
......
...@@ -44,11 +44,7 @@ ...@@ -44,11 +44,7 @@
#include <sys/types.h> #include <sys/types.h>
#ifdef __linux__
#include "aicdb.h" #include "aicdb.h"
#else
#include <db.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <inttypes.h> #include <inttypes.h>
#include <regex.h> #include <regex.h>
......
...@@ -42,11 +42,7 @@ ...@@ -42,11 +42,7 @@
* $FreeBSD$ * $FreeBSD$
*/ */
#ifdef __linux__
#include "../queue.h" #include "../queue.h"
#else
#include <sys/queue.h>
#endif
typedef enum { typedef enum {
UNINITIALIZED, UNINITIALIZED,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment