- Timestamp:
- Jan 2, 2021, 1:06:02 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ReadMe.txt
r201 r205 1 AHCI Driver for OS/2 v2.0 71 AHCI Driver for OS/2 v2.08 2 2 3 3 Introduction … … 16 16 Copyright (c) 2011 thi.guten Software Development 17 17 Copyright (c) 2011 Mensys B.V. 18 Copyright (c) 2013-20 18David Azarewicz18 Copyright (c) 2013-2021 David Azarewicz 19 19 20 20 Authors: Christian Mueller, Markus Thielen … … 388 388 Change Log 389 389 ========== 390 v.2.08 01-Nov-2020 - David Azarewicz 391 Corrected RM ADD handle and unit. 392 390 393 v.2.07 19-May-2019 - David Azarewicz 391 394 Fixed hardware failure recovery to arm ctx hook in watchdog timer. -
trunk/src/os2ahci/ahci.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * ahci.c - ahci hardware access functions 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 29 29 #include "ata.h" 30 30 #include "atapi.h" 31 32 /* -------------------------- macros and constants ------------------------- */33 31 34 32 /* produce ata/atapi function pointer with the given func name */ … … 38 36 ? atapi_##func : ata_##func 39 37 40 41 /* ------------------------ global/static variables ------------------------ */42 38 43 39 /* Initial driver status flags indexed by the board_* constants in os2ahci.h … … 76 72 static u16 irq_used[MAX_IRQ_HANDLERS]; /* IRQ level for each used IRQ */ 77 73 static int irq_used_cnt; /* number of IRQs used */ 78 79 /* ----------------------------- start of code ----------------------------- */80 74 81 75 #ifdef DEBUG … … 680 674 char dev_name[RM_MAX_PREFIX_LEN+ATA_ID_PROD_LEN+1]; 681 675 char *pDevName; 682 static u8 total_dev_cnt;683 676 684 677 if (p >= AHCI_MAX_PORTS) return; … … 737 730 adj.AdjLength = sizeof(adj); 738 731 adj.AdjType = ADJ_ADD_UNIT; 739 adj.Add_Unit.ADDHandle = rm_drvh;740 adj.Add_Unit.UnitHandle = (USHORT)total_dev_cnt;732 adj.Add_Unit.ADDHandle = add_handle; 733 adj.Add_Unit.UnitHandle = iorb_unit(ad_no(ai), p, d); 741 734 742 735 /* create Resource Manager device key string; … … 759 752 760 753 RMCreateDevice(rm_drvh, &dh, &ds, ai->rm_adh, NULL); 761 762 total_dev_cnt++;763 754 764 755 /* try to detect virtualbox environment to enable a hack for IRQ routing */ … … 1420 1411 if (rc) 1421 1412 { 1422 DPRINTF(3," timeout for IORB %x ", vIorb);1413 DPRINTF(3," timeout for IORB %x port=%x", vIorb, p); 1423 1414 iorb_seterr(pIorb, IOERR_ADAPTER_TIMEOUT); 1424 1415 } -
trunk/src/os2ahci/ahci.h
r196 r205 1 /** ****************************************************************************1 /** 2 2 * ahci.h - AHCI-specific constants for os2ahci.h 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 26 26 */ 27 27 28 /* ----------------------------- include files ----------------------------- */29 30 /* -------------------------- macros and constants ------------------------- */31 28 32 29 /****************************************************************************** … … 251 248 #define EM_CTL_ALHD (1UL << 26) /* Activity LED */ 252 249 253 /* ------------------------ typedefs and structures ------------------------ */254 255 250 /* Primitive types 256 251 * -
trunk/src/os2ahci/apm.c
r198 r205 1 /** ****************************************************************************1 /** 2 2 * apm.c - Functions to interface with the legacy APM driver, and suspend / resume functions. 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Portions copyright (c) 2013-2018 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen -
trunk/src/os2ahci/ata.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * ata.c - ATA command processing 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 29 29 #include "ata.h" 30 30 31 /* -------------------------- macros and constants ------------------------- */32 33 /* ------------------------ typedefs and structures ------------------------ */34 35 31 /* -------------------------- function prototypes -------------------------- */ 36 32 … … 42 38 ULONG sector, ULONG count, SCATGATENTRY *sg_list, 43 39 ULONG sg_cnt, int write_through); 44 45 /* ------------------------ global/static variables ------------------------ */46 47 /* ----------------------------- start of code ----------------------------- */48 40 49 41 /****************************************************************************** -
trunk/src/os2ahci/ata.h
r196 r205 1 /** ****************************************************************************1 /** 2 2 * ata.h - ATA structures and macros for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 25 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 26 */ 27 28 /* -------------------------- macros and constants ------------------------- */29 27 30 28 /****************************************************************************** -
trunk/src/os2ahci/atapi.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * atapi.c - ATAPI command processing 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 33 33 #include <Dev32scsi.h> 34 34 35 /* -------------------------- macros and constants ------------------------- */36 37 /* ------------------------ typedefs and structures ------------------------ */38 39 /* -------------------------- function prototypes -------------------------- */40 41 35 static void atapi_req_sense_pp(IORBH FAR16DATA *vIorb, IORBH *pIorb); 42 36 static int atapi_pad_cdb(u8 *cmd_in, u16 cmd_in_len, u8 *cmd_out, u16 *cmd_out_len); 43 44 /* ------------------------ global/static variables ------------------------ */45 46 /* ----------------------------- start of code ----------------------------- */47 37 48 38 /****************************************************************************** -
trunk/src/os2ahci/atapi.h
r196 r205 1 /** ****************************************************************************1 /** 2 2 * atapi.h - ATAPI structures and macros for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 25 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 26 */ 27 28 /* -------------------------- macros and constants ------------------------- */29 27 30 28 #define ATAPI_MIN_CDB_LEN 12 /* minimum ATAPI CDB len acc to AHCI spec */ … … 104 102 #define ATAPI_GET_SENSE(p_) (u8)(p_->sense.sense_key & 0x0f) 105 103 106 /* ------------------------ typedefs and structures ------------------------ */107 108 104 /****************************************************************************** 109 105 * ATAPI_SENSE_DATA - define layout of ATAPI sense data … … 163 159 164 160 165 /* ---------------------------- global variables --------------------------- */166 167 /* -------------------------- function prototypes -------------------------- */168 169 161 extern int atapi_get_geometry(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot); 170 162 extern int atapi_unit_ready(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot); -
trunk/src/os2ahci/ctxhook.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * ctxhook.c - context hooks (kernel thread functions) for os2ahci 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 29 29 #include "ata.h" 30 30 #include "atapi.h" 31 32 /* -------------------------- macros and constants ------------------------- */33 34 /* ------------------------ typedefs and structures ------------------------ */35 36 /* -------------------------- function prototypes -------------------------- */37 38 /* ------------------------ global/static variables ------------------------ */39 31 40 32 /* port restart context hook and input data */ … … 50 42 /* trigger engine context hook and input data */ 51 43 ULONG engine_ctxhook_h; 52 53 /* ----------------------------- start of code ----------------------------- */54 44 55 45 /****************************************************************************** -
trunk/src/os2ahci/ioctl.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * ioctl.c - Generic IOCTL command processing 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 34 34 35 35 #pragma pack(1) 36 37 /* -------------------------- macros and constants ------------------------- */38 39 /* ------------------------ typedefs and structures ------------------------ */40 36 41 37 /* Memory area for IOCTLs which send IORBs downstream; currently only … … 58 54 } IOCTL_CONTEXT; 59 55 60 /* -------------------------- function prototypes -------------------------- */61 62 56 static USHORT do_smart(BYTE unit, BYTE sub_func, BYTE cnt, BYTE lba_l, void *buf); 63 57 static int map_unit(BYTE unit, USHORT *a, USHORT *p, USHORT *d); 64 58 65 59 extern IORBH FAR16DATA * (__far16 *Far16AdrOfIoctlWakeup16)(IORBH FAR16DATA*); 66 67 /* ------------------------ global/static variables ------------------------ */68 69 /* ----------------------------- start of code ----------------------------- */70 60 71 61 /****************************************************************************** -
trunk/src/os2ahci/ioctl.h
r196 r205 1 /** ****************************************************************************1 /** 2 2 * ioctl.h - IOCTL structures and constants for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 25 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 26 */ 27 28 /* -------------------------- macros and constants ------------------------- */29 27 30 28 /* IOCTL categories and functions */ … … 71 69 #define PT_WRITE 0x0001U /* transfer direction host -> device */ 72 70 #define PT_ATAPI 0x0002U /* ATAPI command (ATA if not set) */ 73 74 /* ------------------------ typedefs and structures ------------------------ */75 71 76 72 #ifndef VMDHL_WRITE -
trunk/src/os2ahci/os2ahci.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * os2ahci.c - main file for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 30 30 #include "version.h" 31 31 #include "devhdr.h" 32 33 /* -------------------------- macros and constants ------------------------- */34 32 35 33 /* set two-dimensional array of port options */ … … 55 53 #define TYPE_KRNL_EXIT_INT13 0x0004 /* enable int13 IO */ 56 54 57 /* ------------------------ typedefs and structures ------------------------ */58 59 /* -------------------------- function prototypes -------------------------- */60 61 55 extern int SetPsdPutc(void); 62 56 static int add_unit_info(IORB_CONFIGURATION *iorb_conf, int dt_ai, int a, int p, int d, int scsi_id); 63 57 64 /* ------------------------ global/static variables ------------------------ */65 58 int thorough_scan = 1; /* if != 0, perform thorough PCI scan */ 66 59 int init_reset = 1; /* if != 0, reset ports during init */ … … 106 99 107 100 char BldLevel[] = BLDLEVEL; 108 109 /* ----------------------------- start of code ----------------------------- */110 101 111 102 /****************************************************************************** … … 1550 1541 1551 1542 Timer_CancelTimer(timer_handle); 1552 dprintf(0,"timeout for IORB %x \n", vIorb);1543 dprintf(0,"timeout for IORB %x port=%x\n", vIorb, p); 1553 1544 1554 1545 /* Move the timed-out IORB to the abort queue. Since it's possible that the -
trunk/src/os2ahci/os2ahci.h
r202 r205 1 /** ****************************************************************************1 /** 2 2 * os2ahci.h - main header file for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 25 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 26 */ 27 28 /* ----------------------------- include files ----------------------------- */29 27 30 28 /* IMPORTANT NOTE: The DDK headers require tight structure packing and this … … 48 46 #include "ahci.h" 49 47 #include "ahci-idc.h" 50 51 /* -------------------------- macros and constants ------------------------- */52 48 53 49 #define MAX_AD 8 /* maximum number of adapters */ … … 358 354 /* These are the four entries which correspond to the entries in the partition table. */ 359 355 } DLA_Table_Sector, *PDLA_Table_Sector; 360 361 /* -------------------------- function prototypes -------------------------- */362 356 363 357 static inline unsigned long readl(void *a) … … 473 467 474 468 475 /* ---------------------------- global variables --------------------------- */476 477 469 extern int thorough_scan; /* if != 0, perform thorough PCI scan */ 478 470 extern int init_reset; /* if != 0, reset ports during init */ -
trunk/src/os2ahci/pci.c
r196 r205 1 /** ****************************************************************************1 /** 2 2 * PCI.c - PCI constants and detection code for os2ahci driver 3 3 * 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-20 18 David Azarewicz6 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 28 28 #include "os2ahci.h" 29 29 30 /* -------------------------- macros and constants ------------------------- */31 32 30 /* offset of PCI base address register (BAR) in the PCI config space */ 33 31 #define PCI_BAR(reg) (UCHAR) (0x10 + (reg) * sizeof(u32)) 34 35 /* ------------------------ typedefs and structures ------------------------ */36 37 /* -------------------------- function prototypes -------------------------- */38 32 39 33 static void add_pci_device(PCI_ID *pci_id, USHORT BusDevFunc); 40 34 static long bar_resource(USHORT BusDevFunc, RESOURCESTRUCT *resource, int i); 41 35 static char *rmerr(APIRET ret); 42 43 /* ------------------------ global/static variables ------------------------ */44 36 45 37 /****************************************************************************** … … 245 237 }; 246 238 247 /* ----------------------------- start of code ----------------------------- */248 249 239 /****************************************************************************** 250 240 * Add specified PCI vendor and device ID to the list of supported AHCI -
trunk/src/os2ahci/thunk.asm
r196 r205 1 1 ; Thunking for ahci32 driver 2 ; Copyright (c) 2018 David Azarewicz2 ; Copyright (c) 2018-2021 David Azarewicz 3 3 ; Author: David Azarewicz <david@88watts.net> 4 4 -
trunk/src/os2ahci/trace.c
r204 r205 1 /** ****************************************************************************1 /** 2 2 * 3 * Copyright (c) 2013-20 18 David Azarewicz3 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net> 4 4 * 5 5 */ … … 7 7 #include "os2ahci.h" 8 8 9 /* -------------------------- macros and constants ------------------------- */ 10 11 /* ------------------------ typedefs and structures ------------------------ */ 12 13 /* -------------------------- function prototypes -------------------------- */ 14 15 /* ------------------------ global/static variables ------------------------ */ 16 17 /* ----------------------------- start of code ----------------------------- */ 18 19 /****************************************************************************** 9 /** 20 10 * Create adapter/port/device list for user output. 21 11 */ -
trunk/tools/AddToFile.cmd
r204 r205 55 55 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 56 56 call 'AddToFile.cmd' MyCmd; 57 MyCmd=MyFile||',#define DVMAJ,VERSIONMAJOR,1. 2.3';58 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 59 call 'AddToFile.cmd' MyCmd; 60 MyCmd=MyFile||',#define DVMIN,VERSIONMINOR,1. 2.3';61 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 62 call 'AddToFile.cmd' MyCmd; 63 MyCmd=MyFile||',#define DVREV,VERSIONREVISION,1. 2.3';57 MyCmd=MyFile||',#define DVMAJ,VERSIONMAJOR,1.02.03'; 58 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 59 call 'AddToFile.cmd' MyCmd; 60 MyCmd=MyFile||',#define DVMIN,VERSIONMINOR,1.02.03'; 61 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 62 call 'AddToFile.cmd' MyCmd; 63 MyCmd=MyFile||',#define DVREV,VERSIONREVISION,1.02.03'; 64 64 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 65 65 call 'AddToFile.cmd' MyCmd; … … 92 92 93 93 when (LEFT(Function,8)='BLDLEVEL') then do 94 /* option description,BLDLEVEL,Vendor,1.2.3,Description,Fixpack,Asd'; 95 * String ,Function,Parm1 ,Parm2,Parm3 ,Parm4 ,Parm5 96 */ 94 97 Type=SUBSTR(Function,9,1); 95 98 … … 111 114 end 112 115 116 /* Vendor TextVersion Date/Time/Host ASD Revision Fixpack Desc */ 113 117 NewStr='@#'||Parm1||':'||Parm2||'#@##1## '||ProjString||':'||Parm5||':::'||ProjVersion||'::'||Parm4||'@@'||Parm3; 114 118 if (Type='2') then do
Note:
See TracChangeset
for help on using the changeset viewer.