static int proc_write_dump(struct file *foke, const char *buffer, unsigned long count, void *data) { if (buffer[0] == '0') { if (isDumpEnabled()) { DumpDebug("Control Dump Disabled."); g_dumpLogs = 0; } } else if (buffer[0] == '1') { if (!isDumpEnabled()) { DumpDebug("Control Dump Enabled."); g_dumpLogs = 1; } } return 0; }
// receive control data VOID controlReceive(MINIPORT_ADAPTER *Adapter, void *Buffer, unsigned long Length) { PCONTROL_ETHERNET_HEADER hdr; unsigned long flags; ENTER; #if 1 // rx control frame if (isDumpEnabled()) { // dump packets UINT i, l = Length; u_char * b = (u_char *)Buffer; DumpDebug(READ_REG, "Recv packet control [%d] = ", l); printk("<1>\x1b[1;33m[WiMAX]"); for (i = 0; i < Length; i++) { printk(" %02x", b[i]); if (((i + 1) != Length) && (i % 16 == 15)) { printk("\x1b[0m\n<1>\x1b[1;33m[WiMAX]"); } } printk("\x1b[0m\n"); } #endif // check halt flag if (Adapter->bHaltPending) { return; } hdr = (PCONTROL_ETHERNET_HEADER)Buffer; #if 1 //cky 20100311 him relay //cky test if (hdr->Type == 0x2115) // relay type { DumpDebug(TX, "recv: 0x1521 -> 0x1500"); hdr->Type = 0x15; } #endif spin_lock_irqsave(&Adapter->ctl.Q_Received.Lock, flags); // not found, add to pending buffers list controlEnqueueReceivedBuffer(Adapter, hdr->Type, Buffer, Length); // spin_unlock_irqrestore(&Adapter->Control.Lock, flags); spin_unlock_irqrestore(&Adapter->ctl.Q_Received.Lock, flags); LEAVE; }