rc80211_pid_algo.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /*
  2. * Copyright 2002-2005, Instant802 Networks, Inc.
  3. * Copyright 2005, Devicescape Software, Inc.
  4. * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de>
  5. * Copyright 2007-2008, Stefano Brivio <stefano.brivio@polimi.it>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/netdevice.h>
  12. #include <linux/types.h>
  13. #include <linux/skbuff.h>
  14. #include <linux/debugfs.h>
  15. #include <net/mac80211.h>
  16. #include "ieee80211_rate.h"
  17. #ifdef CONFIG_MAC80211_MESH
  18. #include "mesh.h"
  19. #endif
  20. #include "rc80211_pid.h"
  21. /* This is an implementation of a TX rate control algorithm that uses a PID
  22. * controller. Given a target failed frames rate, the controller decides about
  23. * TX rate changes to meet the target failed frames rate.
  24. *
  25. * The controller basically computes the following:
  26. *
  27. * adj = CP * err + CI * err_avg + CD * (err - last_err) * (1 + sharpening)
  28. *
  29. * where
  30. * adj adjustment value that is used to switch TX rate (see below)
  31. * err current error: target vs. current failed frames percentage
  32. * last_err last error
  33. * err_avg average (i.e. poor man's integral) of recent errors
  34. * sharpening non-zero when fast response is needed (i.e. right after
  35. * association or no frames sent for a long time), heading
  36. * to zero over time
  37. * CP Proportional coefficient
  38. * CI Integral coefficient
  39. * CD Derivative coefficient
  40. *
  41. * CP, CI, CD are subject to careful tuning.
  42. *
  43. * The integral component uses a exponential moving average approach instead of
  44. * an actual sliding window. The advantage is that we don't need to keep an
  45. * array of the last N error values and computation is easier.
  46. *
  47. * Once we have the adj value, we map it to a rate by means of a learning
  48. * algorithm. This algorithm keeps the state of the percentual failed frames
  49. * difference between rates. The behaviour of the lowest available rate is kept
  50. * as a reference value, and every time we switch between two rates, we compute
  51. * the difference between the failed frames each rate exhibited. By doing so,
  52. * we compare behaviours which different rates exhibited in adjacent timeslices,
  53. * thus the comparison is minimally affected by external conditions. This
  54. * difference gets propagated to the whole set of measurements, so that the
  55. * reference is always the same. Periodically, we normalize this set so that
  56. * recent events weigh the most. By comparing the adj value with this set, we
  57. * avoid pejorative switches to lower rates and allow for switches to higher
  58. * rates if they behaved well.
  59. *
  60. * Note that for the computations we use a fixed-point representation to avoid
  61. * floating point arithmetic. Hence, all values are shifted left by
  62. * RC_PID_ARITH_SHIFT.
  63. */
  64. /* Adjust the rate while ensuring that we won't switch to a lower rate if it
  65. * exhibited a worse failed frames behaviour and we'll choose the highest rate
  66. * whose failed frames behaviour is not worse than the one of the original rate
  67. * target. While at it, check that the new rate is valid. */
  68. static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
  69. struct sta_info *sta, int adj,
  70. struct rc_pid_rateinfo *rinfo)
  71. {
  72. struct ieee80211_sub_if_data *sdata;
  73. struct ieee80211_supported_band *sband;
  74. int cur_sorted, new_sorted, probe, tmp, n_bitrates, band;
  75. int cur = sta->txrate_idx;
  76. sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
  77. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  78. band = sband->band;
  79. n_bitrates = sband->n_bitrates;
  80. /* Map passed arguments to sorted values. */
  81. cur_sorted = rinfo[cur].rev_index;
  82. new_sorted = cur_sorted + adj;
  83. /* Check limits. */
  84. if (new_sorted < 0)
  85. new_sorted = rinfo[0].rev_index;
  86. else if (new_sorted >= n_bitrates)
  87. new_sorted = rinfo[n_bitrates - 1].rev_index;
  88. tmp = new_sorted;
  89. if (adj < 0) {
  90. /* Ensure that the rate decrease isn't disadvantageous. */
  91. for (probe = cur_sorted; probe >= new_sorted; probe--)
  92. if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
  93. rate_supported(sta, band, rinfo[probe].index))
  94. tmp = probe;
  95. } else {
  96. /* Look for rate increase with zero (or below) cost. */
  97. for (probe = new_sorted + 1; probe < n_bitrates; probe++)
  98. if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
  99. rate_supported(sta, band, rinfo[probe].index))
  100. tmp = probe;
  101. }
  102. /* Fit the rate found to the nearest supported rate. */
  103. do {
  104. if (rate_supported(sta, band, rinfo[tmp].index)) {
  105. sta->txrate_idx = rinfo[tmp].index;
  106. break;
  107. }
  108. if (adj < 0)
  109. tmp--;
  110. else
  111. tmp++;
  112. } while (tmp < n_bitrates && tmp >= 0);
  113. #ifdef CONFIG_MAC80211_DEBUGFS
  114. rate_control_pid_event_rate_change(
  115. &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
  116. sta->txrate_idx, sband->bitrates[sta->txrate_idx].bitrate);
  117. #endif
  118. }
  119. /* Normalize the failed frames per-rate differences. */
  120. static void rate_control_pid_normalize(struct rc_pid_info *pinfo, int l)
  121. {
  122. int i, norm_offset = pinfo->norm_offset;
  123. struct rc_pid_rateinfo *r = pinfo->rinfo;
  124. if (r[0].diff > norm_offset)
  125. r[0].diff -= norm_offset;
  126. else if (r[0].diff < -norm_offset)
  127. r[0].diff += norm_offset;
  128. for (i = 0; i < l - 1; i++)
  129. if (r[i + 1].diff > r[i].diff + norm_offset)
  130. r[i + 1].diff -= norm_offset;
  131. else if (r[i + 1].diff <= r[i].diff)
  132. r[i + 1].diff += norm_offset;
  133. }
  134. static void rate_control_pid_sample(struct rc_pid_info *pinfo,
  135. struct ieee80211_local *local,
  136. struct sta_info *sta)
  137. {
  138. #ifdef CONFIG_MAC80211_MESH
  139. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
  140. #endif
  141. struct rc_pid_sta_info *spinfo = sta->rate_ctrl_priv;
  142. struct rc_pid_rateinfo *rinfo = pinfo->rinfo;
  143. struct ieee80211_supported_band *sband;
  144. u32 pf;
  145. s32 err_avg;
  146. u32 err_prop;
  147. u32 err_int;
  148. u32 err_der;
  149. int adj, i, j, tmp;
  150. unsigned long period;
  151. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  152. spinfo = sta->rate_ctrl_priv;
  153. /* In case nothing happened during the previous control interval, turn
  154. * the sharpening factor on. */
  155. period = (HZ * pinfo->sampling_period + 500) / 1000;
  156. if (!period)
  157. period = 1;
  158. if (jiffies - spinfo->last_sample > 2 * period)
  159. spinfo->sharp_cnt = pinfo->sharpen_duration;
  160. spinfo->last_sample = jiffies;
  161. /* This should never happen, but in case, we assume the old sample is
  162. * still a good measurement and copy it. */
  163. if (unlikely(spinfo->tx_num_xmit == 0))
  164. pf = spinfo->last_pf;
  165. else {
  166. pf = spinfo->tx_num_failed * 100 / spinfo->tx_num_xmit;
  167. #ifdef CONFIG_MAC80211_MESH
  168. if (pf == 100 &&
  169. sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT)
  170. mesh_plink_broken(sta);
  171. #endif
  172. pf <<= RC_PID_ARITH_SHIFT;
  173. sta->fail_avg = ((pf + (spinfo->last_pf << 3)) / 9)
  174. >> RC_PID_ARITH_SHIFT;
  175. }
  176. spinfo->tx_num_xmit = 0;
  177. spinfo->tx_num_failed = 0;
  178. /* If we just switched rate, update the rate behaviour info. */
  179. if (pinfo->oldrate != sta->txrate_idx) {
  180. i = rinfo[pinfo->oldrate].rev_index;
  181. j = rinfo[sta->txrate_idx].rev_index;
  182. tmp = (pf - spinfo->last_pf);
  183. tmp = RC_PID_DO_ARITH_RIGHT_SHIFT(tmp, RC_PID_ARITH_SHIFT);
  184. rinfo[j].diff = rinfo[i].diff + tmp;
  185. pinfo->oldrate = sta->txrate_idx;
  186. }
  187. rate_control_pid_normalize(pinfo, sband->n_bitrates);
  188. /* Compute the proportional, integral and derivative errors. */
  189. err_prop = (pinfo->target << RC_PID_ARITH_SHIFT) - pf;
  190. err_avg = spinfo->err_avg_sc >> pinfo->smoothing_shift;
  191. spinfo->err_avg_sc = spinfo->err_avg_sc - err_avg + err_prop;
  192. err_int = spinfo->err_avg_sc >> pinfo->smoothing_shift;
  193. err_der = (pf - spinfo->last_pf) *
  194. (1 + pinfo->sharpen_factor * spinfo->sharp_cnt);
  195. spinfo->last_pf = pf;
  196. if (spinfo->sharp_cnt)
  197. spinfo->sharp_cnt--;
  198. #ifdef CONFIG_MAC80211_DEBUGFS
  199. rate_control_pid_event_pf_sample(&spinfo->events, pf, err_prop, err_int,
  200. err_der);
  201. #endif
  202. /* Compute the controller output. */
  203. adj = (err_prop * pinfo->coeff_p + err_int * pinfo->coeff_i
  204. + err_der * pinfo->coeff_d);
  205. adj = RC_PID_DO_ARITH_RIGHT_SHIFT(adj, 2 * RC_PID_ARITH_SHIFT);
  206. /* Change rate. */
  207. if (adj)
  208. rate_control_pid_adjust_rate(local, sta, adj, rinfo);
  209. }
  210. static void rate_control_pid_tx_status(void *priv, struct net_device *dev,
  211. struct sk_buff *skb,
  212. struct ieee80211_tx_status *status)
  213. {
  214. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  215. struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
  216. struct ieee80211_sub_if_data *sdata;
  217. struct rc_pid_info *pinfo = priv;
  218. struct sta_info *sta;
  219. struct rc_pid_sta_info *spinfo;
  220. unsigned long period;
  221. struct ieee80211_supported_band *sband;
  222. sta = sta_info_get(local, hdr->addr1);
  223. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  224. if (!sta)
  225. return;
  226. /* Don't update the state if we're not controlling the rate. */
  227. sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
  228. if (sdata->bss && sdata->bss->force_unicast_rateidx > -1) {
  229. sta->txrate_idx = sdata->bss->max_ratectrl_rateidx;
  230. return;
  231. }
  232. /* Ignore all frames that were sent with a different rate than the rate
  233. * we currently advise mac80211 to use. */
  234. if (status->control.tx_rate != &sband->bitrates[sta->txrate_idx])
  235. goto ignore;
  236. spinfo = sta->rate_ctrl_priv;
  237. spinfo->tx_num_xmit++;
  238. #ifdef CONFIG_MAC80211_DEBUGFS
  239. rate_control_pid_event_tx_status(&spinfo->events, status);
  240. #endif
  241. /* We count frames that totally failed to be transmitted as two bad
  242. * frames, those that made it out but had some retries as one good and
  243. * one bad frame. */
  244. if (status->excessive_retries) {
  245. spinfo->tx_num_failed += 2;
  246. spinfo->tx_num_xmit++;
  247. } else if (status->retry_count) {
  248. spinfo->tx_num_failed++;
  249. spinfo->tx_num_xmit++;
  250. }
  251. if (status->excessive_retries) {
  252. sta->tx_retry_failed++;
  253. sta->tx_num_consecutive_failures++;
  254. sta->tx_num_mpdu_fail++;
  255. } else {
  256. sta->tx_num_consecutive_failures = 0;
  257. sta->tx_num_mpdu_ok++;
  258. }
  259. sta->tx_retry_count += status->retry_count;
  260. sta->tx_num_mpdu_fail += status->retry_count;
  261. /* Update PID controller state. */
  262. period = (HZ * pinfo->sampling_period + 500) / 1000;
  263. if (!period)
  264. period = 1;
  265. if (time_after(jiffies, spinfo->last_sample + period))
  266. rate_control_pid_sample(pinfo, local, sta);
  267. ignore:
  268. sta_info_put(sta);
  269. }
  270. static void rate_control_pid_get_rate(void *priv, struct net_device *dev,
  271. struct ieee80211_supported_band *sband,
  272. struct sk_buff *skb,
  273. struct rate_selection *sel)
  274. {
  275. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  276. struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
  277. struct ieee80211_sub_if_data *sdata;
  278. struct sta_info *sta;
  279. int rateidx;
  280. u16 fc;
  281. sta = sta_info_get(local, hdr->addr1);
  282. /* Send management frames and broadcast/multicast data using lowest
  283. * rate. */
  284. fc = le16_to_cpu(hdr->frame_control);
  285. if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
  286. is_multicast_ether_addr(hdr->addr1) || !sta) {
  287. sel->rate = rate_lowest(local, sband, sta);
  288. if (sta)
  289. sta_info_put(sta);
  290. return;
  291. }
  292. /* If a forced rate is in effect, select it. */
  293. sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  294. if (sdata->bss && sdata->bss->force_unicast_rateidx > -1)
  295. sta->txrate_idx = sdata->bss->force_unicast_rateidx;
  296. rateidx = sta->txrate_idx;
  297. if (rateidx >= sband->n_bitrates)
  298. rateidx = sband->n_bitrates - 1;
  299. sta->last_txrate_idx = rateidx;
  300. sta_info_put(sta);
  301. sel->rate = &sband->bitrates[rateidx];
  302. #ifdef CONFIG_MAC80211_DEBUGFS
  303. rate_control_pid_event_tx_rate(
  304. &((struct rc_pid_sta_info *) sta->rate_ctrl_priv)->events,
  305. rateidx, sband->bitrates[rateidx].bitrate);
  306. #endif
  307. }
  308. static void rate_control_pid_rate_init(void *priv, void *priv_sta,
  309. struct ieee80211_local *local,
  310. struct sta_info *sta)
  311. {
  312. /* TODO: This routine should consider using RSSI from previous packets
  313. * as we need to have IEEE 802.1X auth succeed immediately after assoc..
  314. * Until that method is implemented, we will use the lowest supported
  315. * rate as a workaround. */
  316. struct ieee80211_supported_band *sband;
  317. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  318. sta->txrate_idx = rate_lowest_index(local, sband, sta);
  319. sta->fail_avg = 0;
  320. }
  321. static void *rate_control_pid_alloc(struct ieee80211_local *local)
  322. {
  323. struct rc_pid_info *pinfo;
  324. struct rc_pid_rateinfo *rinfo;
  325. struct ieee80211_supported_band *sband;
  326. int i, j, tmp;
  327. bool s;
  328. #ifdef CONFIG_MAC80211_DEBUGFS
  329. struct rc_pid_debugfs_entries *de;
  330. #endif
  331. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  332. pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC);
  333. if (!pinfo)
  334. return NULL;
  335. /* We can safely assume that sband won't change unless we get
  336. * reinitialized. */
  337. rinfo = kmalloc(sizeof(*rinfo) * sband->n_bitrates, GFP_ATOMIC);
  338. if (!rinfo) {
  339. kfree(pinfo);
  340. return NULL;
  341. }
  342. /* Sort the rates. This is optimized for the most common case (i.e.
  343. * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed
  344. * mapping too. */
  345. for (i = 0; i < sband->n_bitrates; i++) {
  346. rinfo[i].index = i;
  347. rinfo[i].rev_index = i;
  348. if (pinfo->fast_start)
  349. rinfo[i].diff = 0;
  350. else
  351. rinfo[i].diff = i * pinfo->norm_offset;
  352. }
  353. for (i = 1; i < sband->n_bitrates; i++) {
  354. s = 0;
  355. for (j = 0; j < sband->n_bitrates - i; j++)
  356. if (unlikely(sband->bitrates[rinfo[j].index].bitrate >
  357. sband->bitrates[rinfo[j + 1].index].bitrate)) {
  358. tmp = rinfo[j].index;
  359. rinfo[j].index = rinfo[j + 1].index;
  360. rinfo[j + 1].index = tmp;
  361. rinfo[rinfo[j].index].rev_index = j;
  362. rinfo[rinfo[j + 1].index].rev_index = j + 1;
  363. s = 1;
  364. }
  365. if (!s)
  366. break;
  367. }
  368. pinfo->target = RC_PID_TARGET_PF;
  369. pinfo->sampling_period = RC_PID_INTERVAL;
  370. pinfo->coeff_p = RC_PID_COEFF_P;
  371. pinfo->coeff_i = RC_PID_COEFF_I;
  372. pinfo->coeff_d = RC_PID_COEFF_D;
  373. pinfo->smoothing_shift = RC_PID_SMOOTHING_SHIFT;
  374. pinfo->sharpen_factor = RC_PID_SHARPENING_FACTOR;
  375. pinfo->sharpen_duration = RC_PID_SHARPENING_DURATION;
  376. pinfo->norm_offset = RC_PID_NORM_OFFSET;
  377. pinfo->fast_start = RC_PID_FAST_START;
  378. pinfo->rinfo = rinfo;
  379. pinfo->oldrate = 0;
  380. #ifdef CONFIG_MAC80211_DEBUGFS
  381. de = &pinfo->dentries;
  382. de->dir = debugfs_create_dir("rc80211_pid",
  383. local->hw.wiphy->debugfsdir);
  384. de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR,
  385. de->dir, &pinfo->target);
  386. de->sampling_period = debugfs_create_u32("sampling_period",
  387. S_IRUSR | S_IWUSR, de->dir,
  388. &pinfo->sampling_period);
  389. de->coeff_p = debugfs_create_u32("coeff_p", S_IRUSR | S_IWUSR,
  390. de->dir, &pinfo->coeff_p);
  391. de->coeff_i = debugfs_create_u32("coeff_i", S_IRUSR | S_IWUSR,
  392. de->dir, &pinfo->coeff_i);
  393. de->coeff_d = debugfs_create_u32("coeff_d", S_IRUSR | S_IWUSR,
  394. de->dir, &pinfo->coeff_d);
  395. de->smoothing_shift = debugfs_create_u32("smoothing_shift",
  396. S_IRUSR | S_IWUSR, de->dir,
  397. &pinfo->smoothing_shift);
  398. de->sharpen_factor = debugfs_create_u32("sharpen_factor",
  399. S_IRUSR | S_IWUSR, de->dir,
  400. &pinfo->sharpen_factor);
  401. de->sharpen_duration = debugfs_create_u32("sharpen_duration",
  402. S_IRUSR | S_IWUSR, de->dir,
  403. &pinfo->sharpen_duration);
  404. de->norm_offset = debugfs_create_u32("norm_offset",
  405. S_IRUSR | S_IWUSR, de->dir,
  406. &pinfo->norm_offset);
  407. de->fast_start = debugfs_create_bool("fast_start",
  408. S_IRUSR | S_IWUSR, de->dir,
  409. &pinfo->fast_start);
  410. #endif
  411. return pinfo;
  412. }
  413. static void rate_control_pid_free(void *priv)
  414. {
  415. struct rc_pid_info *pinfo = priv;
  416. #ifdef CONFIG_MAC80211_DEBUGFS
  417. struct rc_pid_debugfs_entries *de = &pinfo->dentries;
  418. debugfs_remove(de->fast_start);
  419. debugfs_remove(de->norm_offset);
  420. debugfs_remove(de->sharpen_duration);
  421. debugfs_remove(de->sharpen_factor);
  422. debugfs_remove(de->smoothing_shift);
  423. debugfs_remove(de->coeff_d);
  424. debugfs_remove(de->coeff_i);
  425. debugfs_remove(de->coeff_p);
  426. debugfs_remove(de->sampling_period);
  427. debugfs_remove(de->target);
  428. debugfs_remove(de->dir);
  429. #endif
  430. kfree(pinfo->rinfo);
  431. kfree(pinfo);
  432. }
  433. static void rate_control_pid_clear(void *priv)
  434. {
  435. }
  436. static void *rate_control_pid_alloc_sta(void *priv, gfp_t gfp)
  437. {
  438. struct rc_pid_sta_info *spinfo;
  439. spinfo = kzalloc(sizeof(*spinfo), gfp);
  440. if (spinfo == NULL)
  441. return NULL;
  442. spinfo->last_sample = jiffies;
  443. #ifdef CONFIG_MAC80211_DEBUGFS
  444. spin_lock_init(&spinfo->events.lock);
  445. init_waitqueue_head(&spinfo->events.waitqueue);
  446. #endif
  447. return spinfo;
  448. }
  449. static void rate_control_pid_free_sta(void *priv, void *priv_sta)
  450. {
  451. struct rc_pid_sta_info *spinfo = priv_sta;
  452. kfree(spinfo);
  453. }
  454. static struct rate_control_ops mac80211_rcpid = {
  455. .name = "pid",
  456. .tx_status = rate_control_pid_tx_status,
  457. .get_rate = rate_control_pid_get_rate,
  458. .rate_init = rate_control_pid_rate_init,
  459. .clear = rate_control_pid_clear,
  460. .alloc = rate_control_pid_alloc,
  461. .free = rate_control_pid_free,
  462. .alloc_sta = rate_control_pid_alloc_sta,
  463. .free_sta = rate_control_pid_free_sta,
  464. #ifdef CONFIG_MAC80211_DEBUGFS
  465. .add_sta_debugfs = rate_control_pid_add_sta_debugfs,
  466. .remove_sta_debugfs = rate_control_pid_remove_sta_debugfs,
  467. #endif
  468. };
  469. MODULE_DESCRIPTION("PID controller based rate control algorithm");
  470. MODULE_AUTHOR("Stefano Brivio");
  471. MODULE_AUTHOR("Mattias Nissler");
  472. MODULE_LICENSE("GPL");
  473. int __init rc80211_pid_init(void)
  474. {
  475. return ieee80211_rate_control_register(&mac80211_rcpid);
  476. }
  477. void rc80211_pid_exit(void)
  478. {
  479. ieee80211_rate_control_unregister(&mac80211_rcpid);
  480. }
  481. #ifdef CONFIG_MAC80211_RC_PID_MODULE
  482. module_init(rc80211_pid_init);
  483. module_exit(rc80211_pid_exit);
  484. #endif