sharing variables between 2 different software modules in c - c

I am trying to make some changes to the atheros wireless driver.
I am trying to find a way for passing the value of "rx_stats->rs_rssi" from recv.c (./drivers/net/wireless/ath/ath9k/recv.c)
to the file wme.c
(/net/mac80211/wme.c)
my goal is to use the rssi value for smarter queuing choices.

Create an API in recv.c (exported in recv.h) which returns the value in question. This allows any module that needs it access to the value.

Related

SQLDelight v1.4 not generating interface

Since v1.4, SQLDelight generated data class only.
Before, the tool generated interface and a default implementation of this interface.
That was easy to compose objects with associated projections.
Is there any change to get these interface back ?
see this answer: https://github.com/cashapp/sqldelight/pull/1698#issuecomment-646306522
essentially to keep the backwards compatibility i would copy and paste the old interfaces yourself. We made this change because that really should have been the original implementation but we needed interfaces to support autovalue, thats no longer the case so if there are still situations where you need interfaces they should probably be user code

What is the correct place to list and examine ports in erl_driver

In the tutorial for erl_driver there seems to be no indication to where does the first ErlDrvPort object comes from. Say I want to wrap libusb-1.0 to use it from erlang. There is no place in the API described by ErlDrvEntry for any index methods. How does one find a port to open?
Normally you obtain the first port using the erlang:open_port/2 function, usage of which is shown in the code example in section 6.2 of the tutorial you linked to in your question.
Instead of using Ports to wrap a C library, you can also use NIFs. With Nifty there exists even a wrapper generator that does most of the work for you.

Associate OpenCL device with NVAPI device

I am trying to associate the OpenCL GPU devices with NVAPI devices which I get using NvAPI_EnumPhysicalGPUs in the Multi-GPU system.
The thing is, I can use clGetDeviceInfo with CL_DEVICE_VENDOR_ID which is always unique and it is the best way, and I can retrieve the vendor from the NvAPI_SYS_GetChipSetInfo. But it is not associated with the NvPhysicalGpuHandle which I get from NvAPI_EnumPhysicalGPUs. Is there any way to associate this?
Of course, I can just use name, but this is not good.
There is a way to do it. In OpenCL there is a poor documented feature for some reason. You need to call clGetDeviceInfo with constant 0x4008 and it will give you the bus id for the following device handle.
cl_uint busID;
clGetDeviceInfo(device,0x4008,sizeof(cl_uint), &busID,NULL);
printf("%d",busID);
On NvApi side use NvAPI_GPU_GetBusId. Then you can associate the handles by comapring the buses.

Generating an outgoing call in asterisk

I am using asterisk 11.9.0 and i want to generate an outgoing call.I found that for outgoing i have to make a .call file and place it in a var/spool/asterisk/outgoing.I am following the link below
http://the-asterisk-book.com/1.6/call-file.html#call-file-parameter
my code is same as given in the above link,the above example uses only single fixed number to call.
My problem is that
i have to generate an outgoing to a number fetched from database(outgoing to new number everytime),so how to write the code of .call file for multiple numbers outgoing and how to pass these numbers fetched from database to .call file from my extensions.conf
Is there any way to do that.
I am new to asterisk.
Any help would be appreciated.
You can use vicidial.org software to do that things.
Note, it is very bad idea do outboudn dialler-like app in asterisk without understanding asterisk logic and very-hi skills in programming/database.
For more info you also can use this page
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
Might be easier using WombatDialer as it has a plain API where you can tell it what you want it to do and it will take care of the rest. We have a plain set up for outbound and it took maybe a couple of days from zero to what we have now. ViciDial would have been overkill.
On why rolling your own is not a great idea, the Wombat manual is quite clear: http://manuals.loway.ch/WD_UserManual-chunked/ch01.html#_why_was_wombatdialer_created
You could also use the AMI (Asterisk Manager Interface), would be easier to program with a deamon running in the back to control what gets dialed and the responses to those dials. Mora info here https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239.

Is there a way to determine the loading order of apache modules

I'm developing an Apache based application witch few custom modules.
I'd like to share some functionality in one module with others.
I need to wire them together during stratup phase.
I want to use GetModuleHandle + GetProcAddress (it will rununder Windows only) with a module name - but this will succeed only if the module is already loaded by Apache server.
Is there a way to configure the loading order of Apache modules.
I only need to control my modules - others are irrelevant.
Thank's in advance.
If you're trying to control the Apache hook calling order from the source of your module, you can try using APR_HOOK_FIRST, APR_HOOK_MIDDLE, and APR_HOOK_LAST. Or you can specifically name other modules to enforce ordering constraints. From the docs:
... "There are two mechanisms for doing this. The first, rather crude, method, allows us to specify roughly where the hook is run relative to other modules. The final argument control this. There are three possible values: APR_HOOK_FIRST, APR_HOOK_MIDDLE and APR_HOOK_LAST.
"All modules using any particular value may be run in any order relative to each other, but, of course, all modules using APR_HOOK_FIRST will be run before APR_HOOK_MIDDLE which are before APR_HOOK_LAST. Modules that don't care when they are run should use APR_HOOK_MIDDLE. These values are spaced out, so that positions like APR_HOOK_FIRST-2 are possible to hook slightly earlier than other functions. ...
"The other method allows finer control. When a module knows that it must be run before (or after) some other modules, it can specify them by name. The second (third) argument is a NULL-terminated array of strings consisting of the names of modules that must be run before (after) the current module. For example, suppose we want "mod_xyz.c" and "mod_abc.c" to run before we do, then we'd hook as follows ..." [example follows]

Resources