Hi,
we have in :
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c
struct nic {
/* Begin: frequently used values: keep adjacent for cache effect */
u32 msg_enable cacheline_aligned;
struct net_device *netdev;
Dear All:
int memcmp(const void *cs, const void *ct, size_t count)
{
const unsigned char *su1, *su2;
int res = 0;
for (su1 = cs, su2 = ct; 0 count; ++su1, ++su2, count--)
if ((res = *su1 - *su2) != 0)
break;
return res;
}
I want to know why it
On Mon, 08 Apr 2013 08:57:01 +0800, Ben Wu said:
int memcmp(const void *cs, const void *ct, size_t count)
{
I want to know why it use the temp pointer su1, su2? why it doesn't directly
use the cs and ct pointer?
This is a C 101 question, not a kernel question. But anyhow..
They're
On Mon, Apr 8, 2013 at 5:33 AM, valdis.kletni...@vt.edu wrote:
On Mon, 08 Apr 2013 08:57:01 +0800, Ben Wu said:
int memcmp(const void *cs, const void *ct, size_t count)
{
I want to know why it use the temp pointer su1, su2? why it doesn't directly
use the cs and ct pointer?
This is a C
On Mon, 08 Apr 2013 05:56:29 +0400, Max Filippov said:
const is the the object they point to, not the pointers themselves
(that would be
void * const cs).
memcmp compares bytes at which cs and ct point, but these are void pointers,
and the expression res = *cs - *ct is thus meaningless.
于 2013-4-8 10:29, valdis.kletni...@vt.edu 写道:
On Mon, 08 Apr 2013 05:56:29 +0400, Max Filippov said:
const is the the object they point to, not the pointers themselves
(that would be
void * const cs).
memcmp compares bytes at which cs and ct point, but these are void pointers,
and the
As far i have read the packet reception i have found out that
When working in interrupt driven model, the nic registers an
interrupt handler;
• This interrupt handler will be called when a frame is received;
• Typically in the handler, we allocate sk buff by calling
dev alloc skb();
• Copies data