2

我目前正在研究 WiFI (net/mac80211) (三星 Galaxy S3---GT-I9300---kernel) 的内核源代码

我已经看到了如下代码:

/*
 * Scanning implementation
 *
 * Copyright 2003, Jouni Malinen <jkmaline@cc.hut.fi>
 * Copyright 2004, Instant802 Networks, Inc.
 * Copyright 2005, Devicescape Software, Inc.
 * Copyright 2006-2007  Jiri Benc <jbenc@suse.cz>
 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/pm_qos_params.h>
#include <net/sch_generic.h>
#include <linux/slab.h>
#include <net/mac80211.h>

#include "ieee80211_i.h"
#include "driver-ops.h"
#include "mesh.h"

#define IEEE80211_PROBE_DELAY (HZ / 33)
#define IEEE80211_CHANNEL_TIME (HZ / 33)
#define IEEE80211_PASSIVE_CHANNEL_TIME (HZ / 8)

在代码的底部,它定义了关于变量“HZ”的 PROBE_DELAY、CHANNEL_TIME、PASSIVE_CHANNEL_TIME

因此,我键入grep -r "HZ" ./ >> ~/grep_result以查找 HZ 的定义位置。

但是,结果,没有定义,HZ 的声明。

我在哪里可以找到 HZ 的确切值?

如果我找到 HZ 值,单位是什么?

4

1 回答 1

3

HZ 通常定义为CONFIG_HZ。CONFIG_HZ 是在make config过程中定义的

通用定义在

包括/asm-generic/param.h;

架构特定的定义在

拱//包括/asm/param.h

它倾向于简单地定义它CONFIG_HZ;请注意,您可能会在

拱//包括/asm/uapi/param.h

内核不使用这些 HZ 定义,它们是用户空间 API 接口值;

希望这可以帮助。

于 2013-05-09T06:37:23.967 回答