Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 152622 Details for
Bug 236469
Add ps3_system_bus support
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
PS3 system bus support for kudzu
kudzu-1.2.68-ps3.patch (text/plain), 9.12 KB, created by
David Woodhouse
on 2007-04-14 18:36:11 UTC
(
hide
)
Description:
PS3 system bus support for kudzu
Filename:
MIME Type:
Creator:
David Woodhouse
Created:
2007-04-14 18:36:11 UTC
Size:
9.12 KB
patch
obsolete
>--- kudzu-1.2.68/device.h~ 2006-08-28 04:04:34.000000000 +0100 >+++ kudzu-1.2.68/device.h 2007-04-14 18:33:14.000000000 +0100 >@@ -71,7 +71,8 @@ enum deviceBus { > BUS_MACIO = (1 << 16), > BUS_VIO = (1 << 17), > BUS_S390 = (1 << 18), >- BUS_XEN = (1 << 19) >+ BUS_XEN = (1 << 19), >+ BUS_PS3 = (1 << 20) > }; > > struct device { >--- kudzu-1.2.68/kudzu.c~ 2006-11-16 19:25:08.000000000 +0000 >+++ kudzu-1.2.68/kudzu.c 2007-04-14 19:15:09.000000000 +0100 >@@ -31,6 +31,7 @@ > #include "scsi.h" > #include "vio.h" > #include "xen.h" >+#include "ps3.h" > > #include <ctype.h> > #include <dirent.h> >@@ -76,6 +77,7 @@ static struct { > { "VESA VGA", "fbdev" }, > { "VGA16 VGA", "fbdev" }, > { "xen", "fbdev" }, >+{ "PS3 FB", "fbdev" }, > { NULL, NULL }, > }; > >@@ -136,11 +138,13 @@ struct bus buses[] = { > { BUS_ADB, "ADB", (newFunc *)adbNewDevice, NULL, NULL, adbProbe }, > { BUS_MACIO, "MACIO", (newFunc *)macioNewDevice, NULL, NULL, macioProbe }, > { BUS_VIO, "VIO", (newFunc *)vioNewDevice, NULL, NULL, vioProbe }, >+ { BUS_PS3, "PS3", (newFunc *)ps3NewDevice, NULL, NULL, ps3Probe }, > #endif > #if !defined(__LOADER__) || defined(__s390__) || defined(__s390x__) > { BUS_S390, "S390", (newFunc *)s390NewDevice, NULL, NULL, s390Probe }, > #endif > { BUS_XEN, "XEN", (newFunc *)xenNewDevice, NULL, NULL, xenProbe }, >+ > { 0, NULL, NULL, NULL, NULL, NULL } > }; > >--- kudzu-1.2.68/kudzumodule.c~ 2007-03-26 19:23:01.000000000 +0100 >+++ kudzu-1.2.68/kudzumodule.c 2007-04-14 18:32:17.000000000 +0100 >@@ -30,6 +30,7 @@ > #include "usb.h" > #include "vio.h" > #include "xen.h" >+#include "ps3.h" > > typedef struct { > char * name; >@@ -88,6 +89,7 @@ static TableEntry busTable[] = { > { "BUS_VIO", BUS_VIO}, > { "BUS_S390", BUS_S390}, > { "BUS_XEN", BUS_XEN}, >+ { "BUS_PS3", BUS_PS3}, > { NULL } > }; > >@@ -359,6 +361,11 @@ void addXenInfo(PyObject *dict,struct xe > return; > } > >+void addPS3Info(PyObject *dict,struct ps3Device * device) >+{ >+ return; >+} >+ > PyObject * createDict(struct device * probedDevice) > { > PyObject *dict; >@@ -447,6 +454,9 @@ PyObject * createDict(struct device * pr > case BUS_XEN: > addXenInfo(dict,(struct xenDevice*)probedDevice); > break; >+ case BUS_PS3: >+ addPS3Info(dict,(struct ps3Device*)probedDevice); >+ break; > default: > break; > } >--- kudzu-1.2.68/Makefile~ 2007-04-14 01:09:04.000000000 +0100 >+++ kudzu-1.2.68/Makefile 2007-04-14 19:14:52.000000000 +0100 >@@ -31,8 +31,8 @@ RANLIB = ranlib > HEADERS = device.h alias.h adb.h ddc.h firewire.h ide.h isapnp.h keyboard.h kudzu.h macio.h misc.h modules.h \ > parallel.h pci.h pcmcia.h psaux.h usb.h sbus.h scsi.h serial.h > OBJS = kudzu.o modules.o pci.o pcmcia.o serial.o ide.o misc.o scsi.o parallel.o psaux.o usb.o sbus.o keyboard.o \ >- ddc.o isapnp.o firewire.o adb.o macio.o vio.o s390.o alias.o xen.o >-LOADEROBJ = kudzu_loader.o misc.o pci.o pcmcia.o scsi.o ide.o usb.o firewire.o alias.o xen.o >+ ddc.o isapnp.o firewire.o adb.o macio.o vio.o s390.o alias.o xen.o ps3.o >+LOADEROBJ = kudzu_loader.o misc.o pci.o pcmcia.o scsi.o ide.o usb.o firewire.o alias.o xen.o ps3.o > > ifeq (sparc,$(ARCH)) > LOADEROBJ += sbus.o >--- kudzu-1.2.68/ps3.c~ 2007-04-14 19:25:53.000000000 +0100 >+++ kudzu-1.2.68/ps3.c 2007-04-14 19:24:29.000000000 +0100 >@@ -0,0 +1,160 @@ >+/* Copyright 2005 Red Hat, Inc. >+ * >+ * This software may be freely redistributed under the terms of the GNU >+ * public license. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >+ * >+ */ >+ >+#include <ctype.h> >+#include <dirent.h> >+#include <fcntl.h> >+#include <stdio.h> >+#include <stdlib.h> >+#include <string.h> >+#include <unistd.h> >+#include <sys/ioctl.h> >+#include <linux/fd.h> >+ >+#include "ps3.h" >+#include "kudzuint.h" >+#include "modules.h" >+ >+static void ps3FreeDevice(struct ps3Device *dev) >+{ >+ freeDevice((struct device *) dev); >+} >+ >+static void ps3WriteDevice(FILE *file, struct ps3Device *dev) >+{ >+ writeDevice(file, (struct device *)dev); >+} >+ >+static int ps3CompareDevice(struct ps3Device *dev1, struct ps3Device *dev2) >+{ >+ return compareDevice( (struct device *)dev1, (struct device *)dev2); >+} >+ >+struct ps3Device *ps3NewDevice(struct ps3Device *old) >+{ >+ struct ps3Device *ret; >+ >+ ret = malloc(sizeof(struct ps3Device)); >+ memset(ret, '\0', sizeof(struct ps3Device)); >+ ret = (struct ps3Device *) newDevice((struct device *) old, (struct device *) ret); >+ ret->bus = BUS_PS3; >+ ret->newDevice = ps3NewDevice; >+ ret->freeDevice = ps3FreeDevice; >+ ret->writeDevice = ps3WriteDevice; >+ ret->compareDevice = ps3CompareDevice; >+ return ret; >+} >+ >+struct device *ps3Probe(enum deviceClass probeClass, int probeFlags, >+ struct device *devlist) >+{ >+ struct ps3Device *ps3dev; >+ >+ if ((probeClass & CLASS_USB) || >+ (probeClass & CLASS_NETWORK)) { >+ DIR * dir; >+ struct dirent * ent; >+ >+ if (access("/sys/bus/ps3_system_bus/devices", R_OK)) >+ return devlist; >+ >+ dir = opendir("/sys/bus/ps3_system_bus/devices"); >+ while ((ent = readdir(dir))) { >+ char path[64]; >+ int fd; >+ char alias[16]; >+ >+ snprintf(path, 64, "/sys/bus/ps3_system_bus/devices/%s/modalias", ent->d_name); >+ >+ fd = open(path, O_RDONLY); >+ if (fd < 0) >+ continue; >+ memset(alias, 0, 16); >+ if (read(fd, alias, 15) <= 0) { >+ close(fd); >+ continue; >+ } >+ close(fd); >+ if (strncmp(alias, "ps3:", 4)) >+ continue; >+ if (alias[5] != '\n') >+ continue; >+ alias[5] = 0; >+ printf("alias[4] is %c\n", alias[4]); >+ if (probeClass & CLASS_USB && alias[4] == '1') { >+ ps3dev = ps3NewDevice(NULL); >+ ps3dev->type = CLASS_USB; >+ ps3dev->desc = strdup("PlayStation 3 EHCI"); >+ } else if (probeClass & CLASS_USB && alias[4] == '2') { >+ ps3dev = ps3NewDevice(NULL); >+ ps3dev->type = CLASS_USB; >+ ps3dev->desc = strdup("PlayStation 3 OHCI"); >+ } else if (probeClass & CLASS_NETWORK && alias[4] == '3') { >+ ps3dev = ps3NewDevice(NULL); >+ ps3dev->type = CLASS_NETWORK; >+ ps3dev->desc = strdup("PlayStation 3 Gigabit Ethernet"); >+ __getSysfsDevice((struct device *)ps3dev, path, "net:",0); >+ if (ps3dev->device) >+ __getNetworkAddr((struct device *)ps3dev, ps3dev->device); >+ else >+ ps3dev->device = strdup("eth"); >+ } else >+ continue; >+ >+ ps3dev->driver = strdup(alias); >+ if (devlist) >+ ps3dev->next = devlist; >+ devlist = (struct device *) ps3dev; >+ } >+ closedir(dir); >+ >+ if (probeClass & CLASS_VIDEO) { >+ char path[64]; >+ int i; >+ char *name; >+ >+ for (i = 0; ; i++) { >+ snprintf(path,64,"/sys/class/graphics/fb%d/name",i); >+ name = __readString(path); >+ if (!name) >+ break; >+ if (!strcmp(name, "PS3 FB")) { >+ ps3dev = ps3NewDevice(NULL); >+ ps3dev->desc = strdup("PlayStation 3 Framebuffer"); >+ ps3dev->type = CLASS_VIDEO; >+ ps3dev->driver = strdup("ps3fb"); >+ ps3dev->classprivate = (void *)strdup("fbdev"); >+ if (devlist) >+ ps3dev->next = devlist; >+ devlist = (struct device *) ps3dev; >+ } >+ } >+ } >+ >+ if (probeClass & CLASS_SCSI) { >+ char model[16]; >+ int fd = open("/proc/device-tree/model", O_RDONLY); >+ if (fd >= 0) { >+ if (read(fd, model, 16) == 14 && !strncmp(model, "PLAYSTATION 3", 13)) { >+ ps3dev = ps3NewDevice(NULL); >+ ps3dev->desc = strdup("PlayStation 3 storage"); >+ ps3dev->driver = strdup("ps3_storage"); >+ ps3dev->type = CLASS_SCSI; >+ if (devlist) >+ ps3dev->next = devlist; >+ devlist = (struct device *) ps3dev; >+ } >+ close(fd); >+ } >+ } >+ } >+ return devlist; >+} >--- kudzu-1.2.68/ps3.h~ 2007-04-14 19:25:54.000000000 +0100 >+++ kudzu-1.2.68/ps3.h 2007-04-14 18:32:59.000000000 +0100 >@@ -0,0 +1,39 @@ >+/* Copyright 2005 Red Hat, Inc. >+ * >+ * This software may be freely redistributed under the terms of the GNU >+ * public license. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >+ * >+ */ >+ >+#ifndef _KUDZU_PS3_H_ >+#define _KUDZU_PS3_H_ >+ >+#include "device.h" >+ >+struct ps3Device { >+ /* common fields */ >+ struct device *next; /* next device in list */ >+ int index; >+ enum deviceClass type; /* type */ >+ enum deviceBus bus; /* bus it's attached to */ >+ char * device; /* device file associated with it */ >+ char * driver; /* driver to load, if any */ >+ char * desc; /* a description */ >+ int detached; >+ void * classprivate; >+ /* ps3-specific fields */ >+ struct ps3Device *(*newDevice) (struct ps3Device *dev); >+ void (*freeDevice) (struct ps3Device *dev); >+ void (*writeDevice) (FILE *file, struct ps3Device *dev); >+ int (*compareDevice) (struct ps3Device *dev1, struct ps3Device *dev2); >+}; >+ >+struct ps3Device *ps3NewDevice(struct ps3Device *dev); >+struct device *ps3Probe(enum deviceClass probeClass, int probeFlags, >+ struct device *devlist); >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236469
:
152622
|
152628
|
152629
|
152635