# Working with rate adaptation implementation



## hapvbk (Apr 6, 2011)

Hi there, 

I am currently working with the rate adaptation for wireless interface in FreeBSD kernel. We are facing some issues and hope that some one has experience with this can help us. 

1. There are three rate adaptation algorithms implemented in the FreeBSD kernel. At a time, there is only one active. As far as I know, if we want to switch and use another  rate adaptation algorithm, we have to change the configuration file to indicate the rate adaptation algorithm we want to use and recompile the whole kernel. 

Is there any other simpler ways to do this since recompiling the whole kernel takes time? 

2. If we build a new rate adaptation algorithm (or modify an existing one), for the testing purpose, can we build it like a module, load it and attach it to the testing interface? I was trying hard with the source code and also created a module for that purpose but it does not work since the handlers for RAA is fixed and we cannot change the name or pointer to that handlers. I appreciate a lot if some one has a solution for this. Again the reason is compiling the whole kernel is really time-consuming for testing purpose. 

Thanks so much for reading. 

HAPVBK


----------



## PseudoCylon (Apr 9, 2011)

hapvbk said:
			
		

> 2. If we build a new rate adaptation algorithm (or modify an existing one), for the testing purpose, can we build it like a module, load it and attach it to the testing interface? I was trying hard with the source code and also created a module for that purpose but it does not work since the handlers for RAA is fixed and we cannot change the name or pointer to that handlers. I appreciate a lot if some one has a solution for this. Again the reason is compiling the whole kernel is really time-consuming for testing purpose.


Yes, you can build it as a module. Can not be sure without looking at the code, but it sounds like you haven't add MODULE_VERSION(9) to your rate module and MODULE_DEPEND(9) to NIC's code. This is how to export functions of your module. Then, other modules, i.e. NIC's driver, can call them.

By the way, by setting KERNFAST `# make buildkernel KERNCONF=[i]my_conf[/i] KERNFAST=1` only modified part of kernel will be rebuilt, so recompile much faster.


----------



## hapvbk (Apr 10, 2011)

PseudoCylon said:
			
		

> Yes, you can build it as a module. Can not be sure without looking at the code, but it sounds like you haven't add MODULE_VERSION(9) to your rate module and MODULE_DEPEND(9) to NIC's code. This is how to export functions of your module. Then, other modules, i.e. NIC's driver, can call them.
> 
> By the way, by setting KERNFAST `# make buildkernel KERNCONF=[i]my_conf[/i] KERNFAST=1` only modified part of kernel will be rebuilt, so recompile much faster.



Hi PseudoCylon,

Thanks so much for your info. I tested compiling the kernel with KERNFAST=1. It is really fast. 

For the solution to the RAA module, I'll test it some time later and let you know if it works. Since I do not want to alter the rest of the driver except the rate adaptation part, I have not added MODULE_DEPEND to other modules. I have not used MODULE_VERSION neither. This is a really good idea.

Thanks again. 


HAPVBK


----------

