Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit005a9d6

Browse files
committed
# move the shell commands into their own directory.
# add a topology switch to PsdDevLister
1 parentae6bd9b commit005a9d6

File tree

7 files changed

+130
-28
lines changed

7 files changed

+130
-28
lines changed

‎rom/usb/poseidon/mmakefile.src‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@ include $(SRCDIR)/config/aros.cfg
44
INCLUDE_FILES := $(call WILDCARD, include/hidd/*.h)
55
%copy_includes path=hidd dir=include/hidd
66

7-
FILES := poseidon.library popo.gui numtostr debug
8-
HIDDFILES := usb_controllerclass usb_deviceclass
9-
10-
FUNCS := \
11-
12-
SHELLFILES := PsdDevLister PsdErrorlog AddUSBClasses AddUSBHardware PsdStackLoader
13-
14-
USER_CPPFLAGS := -DMUIMASTER_YES_INLINE_STDARG -D__POSEIDON_NOLIBBASE__
15-
#USER_CPPFLAGS += -DDEBUG=1
16-
17-
#MM kernel-usb-poseidon-includes : \
18-
#MM kernel-exec-includes \
19-
#MM kernel-dos-includes \
20-
#MM kernel-utility-includes \
21-
#MM kernel-usb-usbclass-includes \
7+
FILES := \
8+
poseidon.library \
9+
popo.gui \
10+
numtostr \
11+
debug
12+
HIDDFILES := \
13+
usb_controllerclass \
14+
usb_deviceclass
15+
16+
FUNCS :=
17+
18+
#MM kernel-usb-poseidon-includes : \
19+
#MM kernel-exec-includes \
20+
#MM kernel-dos-includes \
21+
#MM kernel-utility-includes \
22+
#MM kernel-usb-usbclass-includes \
2223
#MM includes-copy
2324
#MM- kernel-usb-poseidon : linklibs
2425

25-
#MM- kernel-usb-shelltools : kernel-usb-poseidon-includes
26-
2726
#MM- kernel-usb-usbromstartup : kernel-usb-poseidon
2827

29-
%build_progs mmake=kernel-usb-shelltools \
30-
files=$(SHELLFILES) targetdir=$(AROS_C)
31-
28+
USER_CPPFLAGS := \
29+
-DMUIMASTER_YES_INLINE_STDARG \
30+
-D__POSEIDON_NOLIBBASE__
31+
#USER_CPPFLAGS += -DDEBUG=1
3232
USER_LDFLAGS := -static
3333

34-
%build_module mmake=kernel-usb-poseidon \
35-
modname=poseidon modtype=library \
36-
files="$(FUNCS) $(FILES) $(HIDDFILES)" \
34+
%build_module mmake=kernel-usb-poseidon\
35+
modname=poseidon modtype=library\
36+
files="$(FUNCS) $(FILES) $(HIDDFILES)"\
3737
uselibs="debug"
3838

39-
%build_module_simple mmake=kernel-usb-usbromstartup \
40-
modname=usbromstartup modtype=resource \
39+
%build_module_simple mmake=kernel-usb-usbromstartup\
40+
modname=usbromstartup modtype=resource\
4141
files="usbromearlystartup usbromlatestartup" uselibs="amiga"
4242

4343
%common
File renamed without changes.
File renamed without changes.

‎rom/usb/poseidon/PsdDevLister.c‎renamed to ‎rom/usb/poseidon/shellcommands/PsdDevLister.c‎

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,61 @@
1616
#defineARGS_SHOWROOT 0
1717
#defineARGS_QUICK 1
1818
#defineARGS_STRINGS 2
19-
#defineARGS_SIZEOF 3
19+
#defineARGS_TOPOLOGY 3
20+
#defineARGS_SIZEOF 4
2021

21-
staticconstchar*template="SHOWROOT/S,QUICK/S,STRINGS/S";
22-
constchar*version="$VER: PsdDevLister 4.0 (03.06.09) by Chris Hodges <chrisly@platon42.de>";
22+
staticconstchar*template="SHOWROOT/S,QUICK/S,STRINGS/S,TOPOLOGY/S";
23+
constchar*version="$VER: PsdDevLister 4.1 (27.11.2025) by Chris Hodges <chrisly@platon42.de>";
2324
staticIPTRArgsArray[ARGS_SIZEOF];
2425
staticstructRDArgs*ArgsHook=NULL;
2526

27+
structTopologyEntry
28+
{
29+
structNodenode;
30+
APTRdevice;
31+
APTRhub;
32+
IPTRport;
33+
STRPTRproduct;
34+
STRPTRid;
35+
IPTRaddress;
36+
IPTRdevclass;
37+
IPTRdevsubclass;
38+
IPTRdevproto;
39+
};
40+
41+
staticvoidPrintTopology(structList*devices,APTRhub,LONGdepth)
42+
{
43+
structNode*n=devices->lh_Head;
44+
45+
while(n->ln_Succ)
46+
{
47+
structTopologyEntry*entry= (structTopologyEntry*)n;
48+
49+
if(entry->hub==hub)
50+
{
51+
LONGidx;
52+
53+
for(idx=0;idx<depth;idx++)
54+
{
55+
PutStr(" ");
56+
}
57+
58+
Printf("%s%ld: %s (addr %ld, class/sub/proto %ld/%ld/%ld)\n",
59+
depth ?"Port " :"Root ",
60+
entry->port,
61+
entry->product ?entry->product :entry->id,
62+
entry->address,
63+
entry->devclass,
64+
entry->devsubclass,
65+
entry->devproto);
66+
67+
PrintTopology(devices,entry->device,depth+1);
68+
}
69+
70+
n=n->ln_Succ;
71+
}
72+
}
73+
2674
voidfail(char*str)
2775
{
2876
if(ArgsHook)
@@ -132,6 +180,9 @@ int main(int argc, char *argv[])
132180
STRPTRstrdesc;
133181
STRPTRstrthinktime;
134182

183+
structListtopology;
184+
structNode*topologynode;
185+
135186
if(!(ArgsHook=ReadArgs(template,ArgsArray,NULL)))
136187
{
137188
fail("Wrong arguments!\n");
@@ -141,10 +192,12 @@ int main(int argc, char *argv[])
141192
{
142193
pd=NULL;
143194
mp=CreateMsgPort();
195+
NewList(&topology);
144196
psdLockReadPBase();
145197
while((pd=psdGetNextDevice(pd)))
146198
{
147199
psdLockReadDevice(pd);
200+
devhub=NULL;
148201
devhubport=0;
149202
devneedssplit=0;
150203
devlowpower=0;
@@ -193,6 +246,24 @@ int main(int argc, char *argv[])
193246
DA_PowerSupply,&devpoweravail,
194247
DA_DescriptorList,&descriptors,
195248
TAG_END);
249+
if(ArgsArray[ARGS_TOPOLOGY])
250+
{
251+
structTopologyEntry*entry=AllocMem(sizeof(structTopologyEntry),MEMF_CLEAR);
252+
253+
if(entry)
254+
{
255+
entry->device=pd;
256+
entry->hub=devhub;
257+
entry->port=devhubport;
258+
entry->product=devprodname;
259+
entry->id=devidstr;
260+
entry->address=devadr;
261+
entry->devclass=devclass;
262+
entry->devsubclass=devsubclass;
263+
entry->devproto=devproto;
264+
AddTail(&topology, (structNode*)entry);
265+
}
266+
}
196267
if(devhub)
197268
{
198269
psdGetAttrs(PGA_DEVICE,devhub,
@@ -540,6 +611,16 @@ int main(int argc, char *argv[])
540611
psdUnlockDevice(pd);
541612
PutStr("---------------------------------------------------------------------------\n");
542613
}
614+
if(ArgsArray[ARGS_TOPOLOGY])
615+
{
616+
PutStr("USB device topology:\n");
617+
PrintTopology(&topology,NULL,0);
618+
PutStr("---------------------------------------------------------------------------\n");
619+
}
620+
while((topologynode=RemHead(&topology)))
621+
{
622+
FreeMem(topologynode,sizeof(structTopologyEntry));
623+
}
543624
psdUnlockPBase();
544625
DeleteMsgPort(mp);
545626
CloseLibrary(ps);
File renamed without changes.
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
include $(SRCDIR)/config/aros.cfg
3+
4+
SHELLFILES := \
5+
PsdDevLister \
6+
PsdErrorlog \
7+
AddUSBClasses \
8+
AddUSBHardware \
9+
PsdStackLoader
10+
11+
USER_CPPFLAGS := \
12+
-DMUIMASTER_YES_INLINE_STDARG \
13+
-D__POSEIDON_NOLIBBASE__
14+
#USER_CPPFLAGS += -DDEBUG=1
15+
16+
#MM poseidon-usb-shellcommands : kernel-usb-poseidon-includes
17+
18+
%build_progs mmake=poseidon-usb-shellcommands \
19+
files=$(SHELLFILES) targetdir=$(AROS_C)
20+
21+
%common

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp