1
/***************************************************************************
2
* Copyright (C) 2001 by Matthias Hoelzer-Kluepfel <mhk@caldera.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
***************************************************************************/
11
#ifndef __USB_DEVICES_H__
12
#define __USB_DEVICES_H__
17
#if defined(__DragonFly__)
18
#include <bus/usb/usb.h>
19
#include <QStringList>
20
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
21
#include <sys/param.h>
22
# if defined(__FreeBSD_version) && __FreeBSD_version >= 800100
23
# define DISABLE_USBDEVICES_FREEBSD
24
# warning "The USB subsystem has changed in 8.0. Disabling."
26
# include <dev/usb/usb.h>
27
# include <QStringList>
40
void parseLine(const QString &line);
41
void parseSysDir(int bus, int parent, int level, const QString &line);
59
static QList<USBDevice*> &devices() {
62
static USBDevice *find(int bus, int device);
63
static bool parse(const QString& fname);
64
static bool parseSys(const QString& fname);
68
static QList<USBDevice*> _devices;
72
int _bus, _level, _parent, _port, _count, _device, _channels, _power;
75
QString _manufacturer, _product, _serial;
77
int _bwTotal, _bwUsed, _bwPercent, _bwIntr, _bwIso;
80
unsigned int _verMajor, _verMinor, _class, _sub, _prot, _maxPacketSize, _configs;
83
unsigned int _vendorID, _prodID, _revMajor, _revMinor;
85
#if (defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)) && !defined(DISABLE_USBDEVICES_FREEBSD)
86
void collectData( int fd, int level, usb_device_info &di, int parent );
87
QStringList _devnodes;