Ticket #6350: early-acpi-support.diff
File early-acpi-support.diff, 5.6 KB (added by , 14 years ago) |
---|
-
src/apps/devices/Device.cpp
32 32 "Satellite communications controller", // 0x0f 33 33 "Encryption controller", // 0x10 34 34 "Signal processing controller", // 0x11 35 "Computer" // 0x12 (added later) 35 "Computer", // 0x12 (added later) 36 "ACPI controller" // 0x13 (added later) 36 37 }; 37 38 38 39 -
src/apps/devices/DeviceACPI.h
1 /* 2 * Copyright 2008-2010 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Alexander von Gluck (kallisti5) 7 */ 8 #ifndef DEVICEACPI_H 9 #define DEVICEACPI_H 10 11 12 #include "Device.h" 13 14 15 class DeviceACPI : public Device { 16 public: 17 DeviceACPI(Device* parent); 18 virtual ~DeviceACPI(); 19 virtual Attributes GetBusAttributes(); 20 virtual BString GetBusStrings(); 21 virtual void InitFromAttributes(); 22 23 virtual BString GetBusTabName() 24 { return "ACPI Information"; } 25 26 private: 27 uint16 fClassBaseId; 28 uint16 fClassSubId; 29 uint16 fClassApiId; 30 uint16 fVendorId; 31 uint16 fDeviceId; 32 uint16 fSubsystemVendorId; 33 uint16 fSubSystemId; 34 }; 35 36 #endif /* DEVICEACPI_H */ -
src/apps/devices/Device.h
24 24 BUS_ISA = 1, 25 25 BUS_PCI, 26 26 BUS_SCSI, 27 BUS_ACPI, 27 28 BUS_NONE 28 29 } BusType; 29 30 … … 45 46 typedef enum { 46 47 CAT_NONE = 0, 47 48 CAT_BUS = 6, 48 CAT_COMPUTER = 0x12 49 CAT_COMPUTER = 0x12, 50 CAT_ACPI = 0x13 49 51 } Category; 50 52 51 53 -
src/apps/devices/DevicesView.cpp
277 277 // Determine what type of device it is and create it 278 278 for (unsigned int i = 0; i < attributes.size(); i++) { 279 279 // Devices Root 280 if (attributes[i].fName == "device/pretty name"280 if (attributes[i].fName == B_DEVICE_PRETTY_NAME 281 281 && attributes[i].fValue == "Devices Root") { 282 282 newDevice = new Device(parent, BUS_NONE, CAT_COMPUTER, "Computer"); 283 283 break; 284 284 } 285 285 286 // ACPI Controller 287 if (attributes[i].fName == B_DEVICE_PRETTY_NAME 288 && attributes[i].fValue == "ACPI") { 289 newDevice = new Device(parent, BUS_ACPI, CAT_BUS, "ACPI Controller"); 290 break; 291 } 292 286 293 // PCI bus 287 if (attributes[i].fName == "device/pretty name"294 if (attributes[i].fName == B_DEVICE_PRETTY_NAME 288 295 && attributes[i].fValue == "PCI") { 289 296 newDevice = new Device(parent, BUS_PCI, CAT_BUS, "PCI bus"); 290 297 break; 291 298 } 292 299 293 300 // ISA bus 294 if (attributes[i].fName == "device/bus"301 if (attributes[i].fName == B_DEVICE_BUS 295 302 && attributes[i].fValue == "isa") { 296 303 newDevice = new Device(parent, BUS_ISA, CAT_BUS, "ISA bus"); 297 304 break; … … 303 310 newDevice = new DevicePCI(parent); 304 311 break; 305 312 } 313 314 // ACPI device 315 // TODO: This should be a its own device object like DevicePCI above (DeviceACPI? DeviceIO?) 316 // For now they are under COMPUTER to clean up the "Unknown Device" category. 317 if (attributes[i].fName == B_DEVICE_BUS 318 && attributes[i].fValue == "acpi") { 319 //newDevice = new Device(parent, BUS_ACPI, CAT_COMPUTER, "ACPI Node"); 320 newDevice = new DeviceACPI(parent); 321 break; 322 } 306 323 } 307 324 308 325 if (newDevice == NULL) { -
src/apps/devices/DevicesView.h
26 26 27 27 #include "Device.h" 28 28 #include "DevicePCI.h" 29 #include "DeviceACPI.h" 29 30 #include "PropertyList.h" 30 31 #include "PropertyListPlain.h" 31 32 -
src/apps/devices/Jamfile
65 65 DevicesView.cpp 66 66 dm_wrapper.c 67 67 DevicePCI.cpp 68 DeviceACPI.cpp 68 69 Device.cpp 69 70 PropertyList.cpp 70 71 PropertyListPlain.cpp -
src/apps/devices/DeviceACPI.cpp
1 /* 2 * Copyright 2008-2010 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Alexander von Gluck (kallisti5) 7 */ 8 9 10 #include <sstream> 11 #include <stdlib.h> 12 13 #include "DeviceACPI.h" 14 15 16 DeviceACPI::DeviceACPI(Device* parent) 17 : 18 Device(parent), 19 fClassBaseId(0), 20 fClassSubId(0), 21 fClassApiId(0), 22 fVendorId(0), 23 fDeviceId(0), 24 fSubsystemVendorId(0), 25 fSubSystemId(0) 26 { 27 } 28 29 30 DeviceACPI::~DeviceACPI() 31 { 32 } 33 34 35 void 36 DeviceACPI::InitFromAttributes() 37 { 38 SetAttribute("Device name", "ACPI node"); 39 SetAttribute("Manufacturer", "Not implimented"); 40 fCategory = (Category)CAT_ACPI; 41 42 BString outlineName; 43 outlineName = "ACPI node"; 44 SetText(outlineName.String()); 45 } 46 47 48 Attributes 49 DeviceACPI::GetBusAttributes() 50 { 51 Attributes attributes; 52 attributes.push_back(GetAttribute("device/bus")); 53 attributes.push_back(GetAttribute("acpi/path")); 54 attributes.push_back(GetAttribute("acpi/type")); 55 return attributes; 56 } 57 58 59 BString 60 DeviceACPI::GetBusStrings() 61 { 62 BString str; 63 str << "Class Info:\t\t\t\t: " << fAttributeMap["Class Info"]; 64 return str; 65 }