diff --git a/drivers/net/wireless/cw1200/itp.c b/drivers/net/wireless/cw1200/itp.c index 7be3509..c0730bb 100644 --- a/drivers/net/wireless/cw1200/itp.c +++ b/drivers/net/wireless/cw1200/itp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include "cw1200.h" @@ -139,8 +140,6 @@ static const struct file_operations fops_itp = { static void cw1200_itp_fill_pattern(u8 *data, int size, enum cw1200_itp_data_modes mode) { - u8 *p = data; - if (size <= 0) return; @@ -156,14 +155,7 @@ static void cw1200_itp_fill_pattern(u8 *data, int size, memset(data, 0x55, size); break; case ITP_DATA_RANDOM: - while (p < data+size-sizeof(u32)) { - (*(u32 *)p) = random32(); - p += sizeof(u32); - } - while (p < data+size) { - (*p) = random32() & 0xFF; - p++; - } + get_random_bytes(data, size); break; } return; diff --git a/drivers/net/wireless/cw1200/sta.c b/drivers/net/wireless/cw1200/sta.c index bca9c60..7dc0b08 100644 --- a/drivers/net/wireless/cw1200/sta.c +++ b/drivers/net/wireless/cw1200/sta.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "cw1200.h" #include "sta.h" @@ -23,7 +24,6 @@ #define ERP_INFO_BYTE_OFFSET 2 #endif - static void cw1200_do_join(struct cw1200_common *priv); static void cw1200_do_unjoin(struct cw1200_common *priv); diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c index 1667944..4db6cc1 100644 --- a/drivers/net/wireless/cw1200/wsm.c +++ b/drivers/net/wireless/cw1200/wsm.c @@ -1657,7 +1657,7 @@ static int cw1200_get_prio_queue(struct cw1200_common *priv, edca = &priv->edca.params[i]; score = ((edca->aifns + edca->cwmin) << 16) + ((edca->cwmax - edca->cwmin) * - (random32() & 0xFFFF)); + (get_random_int() & 0xFFFF)); if (score < best && (winner < 0 || i != 3)) { best = score; winner = i;