/*! ************************************************************************* * \brief . * * user context. * * \return read character, EOF if end of file. *************************************************************************/ int klib_fgetc( struct file *filp /*!< file pointer */ ) { int len; u_char buf[4]; len = klib_fread((char *)buf, 1, filp); if (len > 0) return buf[0]; else if (len == 0) return -1; else return len; }
void cmc7xx_tune_cpu(struct net_adapter *adapter, int onoff) { struct file *fp2; fp2 = klib_fopen(WIMAX_CPU0SCALING_PATH, O_RDWR, 0); if (!fp2) { dump_debug("open fail"); return; } if ((!onoff) && (adapter->cputunedone)) { adapter->cputunedone = false; klib_fwrite((char *)&adapter->cpu0scaling, strlen(adapter->cpu0scaling), fp2); } else if ((onoff) && (!adapter->cputunedone)) { adapter->cputunedone = true; klib_fread((char *)&adapter->cpu0scaling, sizeof(adapter->cpu0scaling), fp2); klib_fwrite("performance", strlen("performance"), fp2); } klib_fclose(fp2); }