What are the differences between all these files? (external_libsamsung-ipc)
Added by E3V3A XDA almost 11 years ago
I'm wading through your code for the "external_libsamsung-ipc" libraries,
in order to better understand how the XMM modem works in a I9100.
However, I'm finding it very difficult to even get a vague idea what
is doing what and in what order. Especially since the majority of the
code is scarcely commented, at best. I would really love to see a table
listing each file and what it is doing/used for, and some brief note about
where in the source puzzle it fits in. I have looked around your site and
repository about this, but not found anything. Perhaps I've missed it?
Let's start with the "devices" directory.
aries
crespo
galaxys2
i9300
maguro
n7100
piranha
xmm6160
xmm6260
1) What are all these "animal" boards representing (in terms of real life HW)?
2) Why are the modems (xmm6X60) separate from the others?
3) In /samsung-ipc/device/xmm6260/modem.h, I find an entry with "QC_MDM6600". That is Qualcomm, do they also use SIPC?
4) In /samsung-ipc/device/xmm6260/xmm6260.h, I find '#define XMM6260_AT "ATAT"' (line 24), this certainly seem like an AT command-like sequence. Does that mean there's an AT interface available from code, but not exported to user-space? Perhaps in xmm6260_hsic.c:xmm6260_hsic_psi_send() and in the ...mipi... equivalent, where it is used?
Second, let's look at the non-obvious parts of the root directory:
call.c
gen.c
gprs.c
ipc.c
ipc_devices.c
ipc_util.c
misc.c
net.c
rfs.c
sec.c
sms.c
util.c
5) What are each of these doing? What part of the modem functionality are they using? And so on.
Of course I have guessed what some of these are doing, but I think if you like more people to join your efforts, we should minimize this time consuming guessing game. I'm rather surprised that there is no documents, no information, no comments and no leaks or anything at all, that would be very useful for developers. Please note, this is not meant as a criticism to you or your very talented developers, who have spent a tantamount of effort in reversing these protocols. This is clearly understood. But your site and available information doesn't measure up to the knowledge you posses, even by a fraction.
@Paul: You already know how much effort I've spent on trying to document these BP's 2+ years ago, collecting documents, firmware, proprietary tools, and loads of speculation and tests. All of that can be found in my various XDA threads. Where are yours? For example, you used to have some kind of poor-mans memory map of the 6260, in your code. Today I can't even find that, hoping that things would have improved since then... I have talked to many people since those times, and some of them would like to help, and so do I, but without any minimal guidance or documentation to grasp on to, that seem impossible.
Please note, I'd be happy to help write such documentation, if I'm only able to grasp what I'm supposed to be writing about.
Best Regards,
E:V:A
Replies (1)
RE: What are the differences between all these files? (external_libsamsung-ipc) - Added by Paul Kocialkowski almost 11 years ago
First off, I spend some time cleaning the source code in the past six months and the up to date code is branch cleanup
from: http://git.code.paulk.fr/gitweb/?p=libsamsung-ipc.git;a=shortlog;h=refs/heads/cleanup
You should use that instead to figure out how things work.
However, I'm finding it very difficult to even get a vague idea what is doing what and in what order.
The code was made in a way that makes it very easy to follow what is going on since everything is at its right place.
Especially since the majority of the code is scarcely commented, at best.
I agree, there aren't many comments about the general structure of libsamsung-ipc, but rather about very specific implementation topics.
I would really love to see a table listing each file and what it is doing/used for, and some brief note about where in the source puzzle it fits in. I have looked around your site and repository about this, but not found anything. Perhaps I've missed it?
You haven't: there is no global documentation. We thought we would add it at some point but everyone forgot and now I'm the only one left active. It is however not that complicated. The files have very explicit names that make it easy to understand what they're for. There is however no clear documentation about the protocol itself, which is probably required knowledge to make sense of the files names and such.
Let's start with the "devices" directory.
1) What are all these "animal" boards representing (in terms of real life HW)?
Different devices. You can look up ipc_devices.c to see what device uses what (again, the name makes sense). The codenames are the actual names of the hardware -- we're not going to describe them using the commercial names, which do not identify particular devices. You can see there that the device can be detected or static (also look Android.mk to see the static devices definitions).
2) Why are the modems (xmm6X60) separate from the others?
Because different devices use the same modems. While they might use different transport methods, the underlying logic is the same for every device using the same modem, so this translates an effort to have all the common code in common places, hence why we use the modem names.
3) In /samsung-ipc/device/xmm6260/modem.h, I find an entry with "QC_MDM6600". That is Qualcomm, do they also use SIPC?
These are headers coming from the kernel and IIRC some of the kernel code is common for Qualcomm as well, but it doesn't use Samsung-IPC AFAIK. Check the headers to see what was written by us and what wasn't.
4) In /samsung-ipc/device/xmm6260/xmm6260.h, I find '#define XMM6260_AT "ATAT"' (line 24), this certainly seem like an AT command-like sequence. Does that mean there's an AT interface available from code, but not exported to user-space? Perhaps in xmm6260_hsic.c:xmm6260_hsic_psi_send() and in the ...mipi... equivalent, where it is used?
No, that's unrelated. That's the only AT string we could find in the non-free binary. This early in the modem boot process, there is no firmware running on the modem, so trying to issue other AT commands won't work. You could make sure of this by not loading the firmware (disabling the RIL) and switching the USB path to CP (the way xgoldmon does it) and see if you can communicate with the modem using AT. I bet you can't.
5) What are each of these doing? What part of the modem functionality are they using? And so on.
That's the protocol implementation, which would indeed require some explanation. I suggest you look at the headers (include), starting with protocol.h, where the structures are defined. samsung-ipc.h is more about our software implementation than the actual protocol. Each dedicated header (e.g. gprs.h, sec.h, etc) implements one group of modem messages. You can find out easily what each of them do by looking at the commands (sec is about SIM, gprs is about mobile data, pwr about power management, etc). Maybe looking at the new (cleanup) code will make things more clear for you to understand.
Of course I have guessed what some of these are doing, but I think if you like more people to join your efforts, we should minimize this time consuming guessing game. I'm rather surprised that there is no documents, no information, no comments and no leaks or anything at all, that would be very useful for developers. Please note, this is not meant as a criticism to you or your very talented developers, who have spent a tantamount of effort in reversing these protocols. This is clearly understood. But your site and available information doesn't measure up to the knowledge you posses, even by a fraction.
I agree here, but writing documentation takes time. Other developers have joined in in the past and were able to figure out rather quickly how things roll together, so I figured it wasn't that big a deal. I'll try to write such documentation when the whole thing is complete and doesn't need any more core work. Suggestions about which elements to provide details about would be appreciated, it's hard for me to know exactly what to put the emphasis on.
Where are yours? For example, you used to have some kind of poor-mans memory map of the 6260, in your code. Today I can't even find that, hoping that things would have improved since then... I have talked to many people since those times, and some of them would like to help, and so do I, but without any minimal guidance or documentation to grasp on to, that seem impossible.
I don't use XDA to release documentation. The Replicant wiki would be the proper place to do it. And I'm not going to provide more than a description of the protocol and a libsamsung-ipc API guide. I don't think I have more knowledge than what's already in libsamsung-ipc and I don't indent to do research about everything related to the baseband. We wanted to have a free software replacement for the proprietary RIL, not go in-depth about how the modem works. We're not going to have a free implementation for it anytime soon so I'd rather focus on things that can actually help achieve freedom.
Please note, I'd be happy to help write such documentation,
I'd be happy to hear more details about what I should write about exactly. That's already a big part of the work behind writing documentation :)
if I'm only able to grasp what I'm supposed to be writing about.
Feel free to ask any specific question here, since there are no docs anyway…