Commit 8683288a authored by Ben Avison's avatar Ben Avison

Drive (lack of) allocation for permanent SDIO devices fixed

Detail:
  Non-removable SDIO devices were never supposed to be allocated an SDFS
  drive, but were by accident in the secondary (UnitAttached rather than
  SlotAttached) service call.
Admin:
  Applies to boards such as the IGEPv2, with SDIO WiFi chips on the board.


Version 0.06. Tagged as 'SDFS-0_06'
parent 8d0bd7b6
/* (0.05)
/* (0.06)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.05
#define Module_MajorVersion_CMHG 0.06
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jul 2014
#define Module_Date_CMHG 31 Oct 2014
#define Module_MajorVersion "0.05"
#define Module_Version 5
#define Module_MajorVersion "0.06"
#define Module_Version 6
#define Module_MinorVersion ""
#define Module_Date "14 Jul 2014"
#define Module_Date "31 Oct 2014"
#define Module_ApplicationDate "14-Jul-14"
#define Module_ApplicationDate "31-Oct-14"
#define Module_ComponentName "SDFS"
#define Module_ComponentPath "cddl/RiscOS/Sources/FileSys/SDFS/SDFS"
#define Module_FullVersion "0.05"
#define Module_HelpVersion "0.05 (14 Jul 2014)"
#define Module_LibraryVersionInfo "0:5"
#define Module_FullVersion "0.06"
#define Module_HelpVersion "0.06 (31 Oct 2014)"
#define Module_LibraryVersionInfo "0:6"
......@@ -102,6 +102,22 @@ void service_SDIOUnitAttached(uint32_t bus, uint32_t slot, uint32_t rca, uint32_
{
IGNORE(fic);
/* Don't provide a drive for non-removable IO slots */
uint32_t slot_handle = 0;
uint32_t slot_spec;
while (!_swix(SDIO_Enumerate, _INR(0,1)|_OUTR(1,2),
SDIOEnumerate_Slots, slot_handle,
&slot_handle, &slot_spec) && slot_handle != 0)
{
if (((slot_spec & SDIOEnumerate_BusMask) >> SDIOEnumerate_BusShift) == bus &&
((slot_spec & SDIOEnumerate_SlotMask) >> SDIOEnumerate_SlotShift) == slot)
{
if (slot_spec & SDIOEnumerate_Integrated)
return;
break;
}
}
/* Read card registers first, so if the SWIs fail we can just pretend the card
* was never inserted */
uint32_t memory_ocr;
......@@ -254,6 +270,22 @@ void service_SDIOUnitDetached(uint32_t bus, uint32_t slot, uint32_t rca, uint32_
IGNORE(writeprotect);
IGNORE(mmc);
/* Nothing to do for non-removable IO slots */
uint32_t slot_handle = 0;
uint32_t slot_spec;
while (!_swix(SDIO_Enumerate, _INR(0,1)|_OUTR(1,2),
SDIOEnumerate_Slots, slot_handle,
&slot_handle, &slot_spec) && slot_handle != 0)
{
if (((slot_spec & SDIOEnumerate_BusMask) >> SDIOEnumerate_BusShift) == bus &&
((slot_spec & SDIOEnumerate_SlotMask) >> SDIOEnumerate_SlotShift) == slot)
{
if (slot_spec & SDIOEnumerate_Integrated)
return;
break;
}
}
/* There will normally be exactly one drive associated with this bus/slot/RCA
* combination - the only exceptions are if allocation failed, or if this is
* not the first unit to be removed for this card. */
......
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