diff --git a/headers/os/drivers/pnp_devfs.h b/headers/os/drivers/pnp_devfs.h deleted file mode 100644 index 5bca3def2e..0000000000 --- a/headers/os/drivers/pnp_devfs.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2002/03, Thomas Kurschel. All rights reserved. - * Distributed under the terms of the MIT License. - */ - -/* - PnP devfs driver interface. - - The interface follows the normal pnp driver rules, i.e. - your driver creates a node for it and chooses PNP_DEVFS_MODULE_NAME - as the consumer, the type must be PNP_DEVFS_TYPE_NAME. The file - name is set via a PNP_DEVFS_FILENAME item. - - Loading and unloading of your driver is done via the pnp manager. - Hooks are similar to the original devfs interface, but the open - hook gets the driver cookie (as returned by init_device of the - driver) instead of a filename. -*/ - -#ifndef _PNP_DEVFS_H -#define _PNP_DEVFS_H - - -#include -#include - - -// changed open hook - gets cookie returned by init_device instead of name -typedef status_t (*pnp_device_open_hook)(void *device_cookie, uint32 flags, - void **handle_cookie); - -// new interface to devfs -typedef struct pnp_devfs_driver_info { - driver_module_info info; - - pnp_device_open_hook open; // called to open the device - device_close_hook close; // called to close the device - device_free_hook free; // called to free the cookie - device_control_hook control; // called to control the device - device_read_hook read; // reads from the device - device_write_hook write; // writes to the device - device_select_hook select; // start select (can be NULL) - device_deselect_hook deselect; // stop select (can be NULL) - device_read_pages_hook read_pages; // scatter-gather read from the device (can be NULL) - device_write_pages_hook write_pages; // scatter-gather write to the device (can be NULL) -} pnp_devfs_driver_info; - - -// items: -// name under which the device should be published under /dev (required, string) -#define PNP_DEVFS_FILENAME "devfs/filename" - -#define PNP_DEVFS_MODULE_NAME "system/devfs/device_v1" - -#endif diff --git a/src/add-ons/kernel/bus_managers/scsi/scsi.c b/src/add-ons/kernel/bus_managers/scsi/scsi.c index 132cafe881..200ea1250a 100644 --- a/src/add-ons/kernel/bus_managers/scsi/scsi.c +++ b/src/add-ons/kernel/bus_managers/scsi/scsi.c @@ -4,7 +4,6 @@ */ #include "scsi_internal.h" -#include locked_pool_interface *locked_pool; device_manager_info *pnp; diff --git a/src/add-ons/kernel/generic/block_io/block_io_private.h b/src/add-ons/kernel/generic/block_io/block_io_private.h index 758a074131..9d28db86d7 100644 --- a/src/add-ons/kernel/generic/block_io/block_io_private.h +++ b/src/add-ons/kernel/generic/block_io/block_io_private.h @@ -10,9 +10,7 @@ */ #include -#include #include -#include #include #include diff --git a/src/system/kernel/device_manager/devfs.cpp b/src/system/kernel/device_manager/devfs.cpp index a46bf65034..957134dc62 100644 --- a/src/system/kernel/device_manager/devfs.cpp +++ b/src/system/kernel/device_manager/devfs.cpp @@ -450,47 +450,6 @@ translate_partition_access(devfs_partition* partition, off_t& offset, } -static pnp_devfs_driver_info * -create_new_driver_info(device_hooks *ops, int32 version) -{ - pnp_devfs_driver_info *info = (pnp_devfs_driver_info *)malloc( - sizeof(pnp_devfs_driver_info)); - if (info == NULL) - return NULL; - - memset(info, 0, sizeof(driver_module_info)); - - info->open = NULL; - // ops->open is used directly for old devices - info->close = ops->close; - info->free = ops->free; - info->control = ops->control; - info->read = ops->read; - info->write = ops->write; - // depends on api_version - info->select = NULL; - info->deselect = NULL; - - info->read_pages = NULL; - info->write_pages = NULL; - // old devices can't know how to do physical page access - - if (version >= 2) { - // According to Be newsletter, vol II, issue 36, - // version 2 added readv/writev, which we don't support, but also - // select/deselect. - info->select = ops->select; - info->deselect = ops->deselect; - - // ops->readv; - // ops->writev; - // we don't implement scatter-gather atm, so ignore those. - } - - return info; -} - - static status_t get_node_for_path(struct devfs *fs, const char *path, struct devfs_vnode **_node) diff --git a/src/system/kernel/fs/IOScheduler.cpp b/src/system/kernel/fs/IOScheduler.cpp index b73ab7e076..5b58aa5a52 100644 --- a/src/system/kernel/fs/IOScheduler.cpp +++ b/src/system/kernel/fs/IOScheduler.cpp @@ -1,7 +1,7 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ + * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include "IOScheduler.h" @@ -41,9 +41,9 @@ IORequest::IORequest(void *_cookie, off_t _offset, const void *_buffer, size_t _ // #pragma mark - -IOScheduler::IOScheduler(const char *name, pnp_devfs_driver_info *hooks) +IOScheduler::IOScheduler(const char* name, device_module_info* module) : - fDeviceHooks(hooks) + fModule(module) { mutex_init(&fLock, "I/O scheduler queue"); @@ -82,9 +82,9 @@ IOScheduler::Process(IORequest &request) // ToDo: assume locked memory? if (request.write) - return fDeviceHooks->write(request.cookie, request.offset, (const void *)request.virtual_address, &request.size); + return fModule->write(request.cookie, request.offset, (const void *)request.virtual_address, &request.size); - return fDeviceHooks->read(request.cookie, request.offset, (void *)request.virtual_address, &request.size); + return fModule->read(request.cookie, request.offset, (void *)request.virtual_address, &request.size); } diff --git a/src/system/kernel/fs/IOScheduler.h b/src/system/kernel/fs/IOScheduler.h index 4f53b6c353..b12c49e6b2 100644 --- a/src/system/kernel/fs/IOScheduler.h +++ b/src/system/kernel/fs/IOScheduler.h @@ -1,14 +1,12 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ + * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef IO_SCHEDULER_H #define IO_SCHEDULER_H -#include -#include -#include +#include #include #include @@ -34,11 +32,11 @@ class IORequest : public DoublyLinkedListLinkImpl { class IOScheduler { public: - IOScheduler(const char *name, pnp_devfs_driver_info *hooks); + IOScheduler(const char* name, device_module_info* module); ~IOScheduler(); status_t InitCheck() const; - status_t Process(IORequest &request); + status_t Process(IORequest& request); #if 0 static IOScheduler *GetScheduler(); @@ -46,10 +44,10 @@ class IOScheduler { private: int32 Scheduler(); - static int32 scheduler(void *); + static int32 scheduler(void*); private: - pnp_devfs_driver_info *fDeviceHooks; + device_module_info* fModule; mutex fLock; thread_id fThread; DoublyLinkedList fRequests;