type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define MDIO_MASK 0x0f
defines
#define MDIO_ENB_IN 0x02
defines
#define EEPROM_SHIFT_CLK (0x80)
defines
#define EEPROM_DATA_READ1 (0x40)
defines
#define EEPROM_DATA_WRITE0 (0x00)
defines
#define EEPROM_DATA_WRITE1 (0x20)
defines
#define EEPROM_SELECT (0x10)
defines
#define EEPROM_DIR_IN (0x02)
defines
#define EEPROM_READ (0x02)
defines
#define EEPROM_EWEN (0x00)
defines
#define EEPROM_ERASE (0x03)
defines
#define EEPROM_WRITE (0x01)
defines
#define EEPROM_ERALL (0x00)
defines
#define EEPROM_WRAL (0x00)
defines
#define EEPROM_EWDS (0x00)
defines
#define EEPROM_93C46_OPCODE(x) ((x) << 6)
defines
#define EEPROM_93C46_STARTBIT (1 << 8)
functions
__init ezboot_mac_setup(char *str) { unsigned char idx; char str_mac[32], str_byte[3]; char *ptr; strcpy( str_mac, str ); ptr = str_mac; for (idx=0; idx<6; idx++) { str_byte[0] = *ptr++; str_byte[1] = *ptr++; str_byte[2] = 0; ptr ++; ezboot_mac[idx] = simple_strtol( str_byte, NULL, 16 ); ...
functions
u16 READ_FIFO (void *membase) { return (readb (membase) | (((u16)readb (membase)) << 8)); }
functions
void WRITE_FIFO (void *membase, u16 data) { writeb ((u8)data , membase); writeb ((u8)(data >> 8) , membase); }
functions
u16 READ_FIFO (void *membase) { return readw (membase); }
functions
void WRITE_FIFO (void *membase, u16 data) { writew (data, membase); }
functions
void mdio_sync (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int bits; for (bits = 0; bits < 32; bits++) { writeb (MDIO_DATA_WRITE1, ax_base + AX88796_MII_EEPROM); writeb (MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, ax_base + AX88796_MII_EEPROM)...
functions
int mdio_read (struct net_device *ndev, int phy_id, int loc) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u_int cmd = (0xf6<<10)|(phy_id<<5)|loc; int i, retval = 0; mdio_sync (ndev); for (i = 13; i >= 0; i--) { int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE...
functions
void mdio_write (struct net_device *ndev, int phy_id, int loc, int value) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value; int i; mdio_sync (ndev); for (i = 31; i >= 0; i--) { int dat = (cmd&(1<<i)) ? MDIO_DATA_WR...
functions
void eeprom_write_en (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned short cmd = EEPROM_93C46_STARTBIT | EEPROM_93C46_OPCODE(EEPROM_EWEN) | 0x30; unsigned char tmp; int i; // issue a "SB OP Addr" command for (i = 8; i >= 0 ; i--)...
functions
void eeprom_write_dis (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned short cmd = EEPROM_93C46_STARTBIT | EEPROM_93C46_OPCODE (EEPROM_EWDS); unsigned char tmp; int i; // issue a "SB OP Addr" command for (i = 8; i >= 0 ; i--) { t...
functions
int eeprom_write (struct net_device *ndev, unsigned char loc, unsigned short nValue) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned short cmd = EEPROM_93C46_STARTBIT | EEPROM_93C46_OPCODE (EEPROM_WRITE) | loc; unsigned char tmp; int i; int ret = 0; // iss...
functions
data for (i = 15; i >= 0; i--) { tmp = (nValue & (1 << i)) == 0 ? EEPROM_DATA_WRITE0 : EEPROM_DATA_WRITE1; writeb (tmp | EEPROM_SELECT, ax_base + AX88796_MII_EEPROM); writeb (tmp | EEPROM_SELECT | EEPROM_SHIFT_CLK, ax_base + AX88796_MII_EEPROM); }
functions
short eeprom_read (struct net_device *ndev, unsigned char loc) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned short cmd = EEPROM_93C46_STARTBIT | EEPROM_93C46_OPCODE (EEPROM_READ) | loc; unsigned char tmp; unsigned short retValue = 0; int i; // issue a "S...
functions
data for (i = 15; i >= 0; i--) { writeb (EEPROM_SELECT | EEPROM_DIR_IN, ax_base + AX88796_MII_EEPROM); tmp = readb (ax_base + AX88796_MII_EEPROM); if (tmp & EEPROM_DATA_READ1) retValue |= (1 << i); writeb (EEPROM_SELECT | EEPROM_DIR_IN | EEPROM_SHIFT_CLK, ax_base + AX88796_MII_EEPROM); }
functions
void ax88796b_dump_regs (struct ax_device *ax_local) { void __iomem *ax_base = ax_local->membase; u8 cr, i, j; cr = readb (ax_base + E8390_CMD) & E8390_PAGE_MASK; PRINTK (DEBUG_MSG, " Page 0 Page 1 Page 2 Page 3\n"); for (i = 0; i < 0x1F; i++) { PRINTK (DEBUG_MSG, " 0x%02x ", i); for (j = 0; j ...
functions
void ax88796b_dump_phy_regs (struct ax_device *ax_local) { int i; PRINTK (DEBUG_MSG, "Dump PHY registers:\n"); for (i = 0; i < 6; i++) { PRINTK (DEBUG_MSG, " MR%d = 0x%04x\n", i, mdio_read (ax_local->ndev, 0x10, i)); }
functions
void ax88796b_get_drvinfo (struct net_device *ndev, struct ethtool_drvinfo *info) { /* Inherit standard device info */ strncpy (info->driver, DRV_NAME, sizeof info->driver); strncpy (info->version, DRV_VERSION, sizeof info->version); }
functions
u32 ax88796b_get_link (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); return ax_get_link (ax_local); }
functions
void ax88796b_get_wol (struct net_device *ndev, struct ethtool_wolinfo *wolinfo) { struct ax_device *ax_local = ax_get_priv (ndev); wolinfo->supported = WAKE_PHY | WAKE_MAGIC; wolinfo->wolopts = 0; if (ax_local->wol & WAKEUP_LSCWE) wolinfo->wolopts |= WAKE_PHY; if (ax_local->wol & WAKE_MAGIC) wolinfo->wolop...
functions
int ax88796b_set_wol (struct net_device *ndev, struct ethtool_wolinfo *wolinfo) { struct ax_device *ax_local = ax_get_priv (ndev); ax_local->wol = 0; if (wolinfo->wolopts & WAKE_PHY) ax_local->wol |= WAKEUP_LSCWE; if (wolinfo->wolopts & WAKE_MAGIC) ax_local->wol |= WAKEUP_MP; return 0; }
functions
int ax88796b_get_settings (struct net_device *ndev, struct ethtool_cmd *cmd) { struct ax_device *ax_local = ax_get_priv (ndev); return mii_ethtool_gset(&ax_local->mii, cmd); }
functions
int ax88796b_set_settings (struct net_device *ndev, struct ethtool_cmd *cmd) { struct ax_device *ax_local = ax_get_priv (ndev); int retval; retval = mii_ethtool_sset (&ax_local->mii, cmd); return retval; }
functions
int ax88796b_nway_reset (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); return mii_nway_restart(&ax_local->mii); }
functions
void ax88796b_load_macaddr (struct net_device *ndev, unsigned char *pMac) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int i; struct {unsigned char value, offset; }
functions
void ax88796b_set_macaddr (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u8 i; /* Copy the station address into the DS8390 registers. */ writeb (E8390_NODMA | E8390_PAGE1, ax_base + E8390_CMD); writeb (NESM_START_PG + TX_PAGES + 1, ax_base + EN1_CU...
functions
int ax88796b_set_mac_address (struct net_device *ndev, void *p) { struct ax_device *ax_local = ax_get_priv (ndev); struct sockaddr *addr = p; unsigned long flags; if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len); spin_lock_irqsave (&ax_loca...
functions
void ax88796b_reset (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned long reset_start_time = jiffies; readb (ax_base + EN0_RESET); ax_local->dmaing = 0; while ((readb (ax_base + EN0_SR) & ENSR_DEV_READY) == 0) { if (jiffies - reset_start...
functions
void make_mc_bits (u8 *bits, struct net_device *ndev) { u32 crc; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) struct dev_mc_list *dmi; for (dmi=ndev->mc_list; dmi; dmi=dmi->next) { if (dmi->dmi_addrlen != ETH_ALEN) { PRINTK (INIT_MSG, PFX " invalid multicast address length given.\n"); continue; }
functions
void do_set_multicast_list (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int i; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) int mc_count = ndev->mc_count; #else int mc_count = netdev_mc_count (ndev); #endif if (!(ndev->flags & (IFF_PROMISC |...
functions
void ax88796b_set_multicast_list (struct net_device *ndev) { unsigned long flags; struct ax_device *ax_local = ax_get_priv (ndev); PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); spin_lock_irqsave (&ax_local->page_lock, flags); do_set_multicast_list (ndev); spin_unlock_irqrestore (&ax_local-...
functions
int ax88796_PHY_init (struct net_device *ndev, u8 echo) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u16 advertise; u16 phy14h, phy15h, phy16h; u8 rty_cnt; /* Enable AX88796B FOLW CONTROL */ writeb (ENFLOW_ENABLE, ax_base+EN0_FLOW); rty_cnt = 0; restart: mdio_write (n...
functions
else if (++rty_cnt > 10) { PRINTK (ERROR_MSG, PFX "Failed to restore PHY default setting"); return -EIO; }
functions
int ax88796b_init (struct net_device *ndev, int startp) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int ret = 0; /* Follow National Semi's recommendations for initing the DP83902. */ writeb (E8390_NODMA | E8390_PAGE0 | E8390_STOP, ax_base + E8390_CMD); writeb (ax_local->...
functions
void ax_media_link (struct net_device *ndev) { u16 phy_reg; phy_reg = mdio_read (ndev, 0x10, MII_BMCR); PRINTK (DRIVER_MSG, "%s: link up, %sMbps, %s-duplex\n", ndev->name, (phy_reg & BMCR_SPEED100 ? "100" : "10"), (phy_reg & BMCR_FULLDPLX ? "Full" : "Half")); netif_carrier_on (ndev); netif_wake_queue (ndev)...
functions
int ax_get_link (struct ax_device *ax_local) { u8 nway_done = 1; u16 phy_reg; phy_reg = mdio_read (ax_local->ndev, 0x10, MII_BMCR); if (phy_reg & BMCR_ANENABLE) nway_done = (mdio_read (ax_local->ndev, 0x10, MII_BMSR) & BMSR_ANEGCOMPLETE) ? 1 : 0; if (nway_done) return mii_link_ok (&ax_local->mii); ret...
functions
void ax88796b_watchdog (unsigned long arg) { struct net_device *ndev = (struct net_device *)(arg); struct ax_device *ax_local = ax_get_priv (ndev); unsigned long time_to_wake = AX88796_WATCHDOG_PERIOD_50MS; u8 link; u16 phy_reg; switch (ax_local->state) { case wait_autoneg: if (ax_get_link (ax_local)) { ...
functions
else if (ax_local->tick_times-- < 0) { ax_local->state = chk_cable_exist; ax_local->tick_times = (1800 / 50); //1.8s }
functions
else if (--ax_local->tick_times <= 0) { mii_nway_restart(&ax_local->mii); ax_local->state = chk_cable_exist_again; ax_local->tick_times = (6 * 1000 / 50); //6s }
functions
else if (--ax_local->tick_times <= 0) { ax_local->phy_advertise = mdio_read (ndev, 0x10, MII_ADVERTISE); ax_local->phy_bmcr = mdio_read (ndev, 0x10, MII_BMCR); mdio_write (ndev, 0x10, MII_BMCR, BMCR_PDOWN); time_to_wake = AX88796_WATCHDOG_PERIOD_3S; ax_local->state = phy_power_up; }
functions
else if (--ax_local->tick_times <= 0) { mdio_write (ndev, 0x10, 0x16, 0x4040); mii_nway_restart(&ax_local->mii); ax_local->state = chk_cable_exist_again; ax_local->tick_times = (6 * 1000 / 50); //6s }
functions
void ax88796b_get_hdr (struct net_device *ndev, struct ax_pkt_hdr *hdr, int ring_page) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u16 *buf = (u16 *)hdr; /* This shouldn't happen. If it does, it's the last thing you'll see */ if (ax_local->dmaing) { PRINTK (ERROR_...
functions
void ax88796b_block_input (struct net_device *ndev, int count, struct sk_buff *skb, int ring_offset) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; u16 *buf = (u16 *)skb->data; u16 i; /* This shouldn't happen. If it does, it's the last thing you'll see */ if (ax_loca...
functions
void ax88796b_receive (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned char rxing_page, this_frame, next_frame; unsigned short current_offset; struct ax_pkt_hdr rx_frame; int pkt_cnt = 0; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\...
functions
void ax_trigger_send (struct net_device *ndev, unsigned int length, int start_page) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; writeb (E8390_NODMA | E8390_PAGE0, ax_base + E8390_CMD); writeb (length & 0xff, ax_base + EN0_TCNTLO); writeb (length >> 8, ax_base + EN0_TCNT...
functions
void ax_block_output (struct net_device *ndev, int count, const unsigned char *buf, const int start_page) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned long dma_start; /* This shouldn't happen. If it does, it's the last thing you'll see */ if (ax_local->dmai...
functions
int ax88796b_start_xmit (struct sk_buff *skb, struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int send_length; unsigned long flags; u8 ctepr=0, free_pages=0, need_pages; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); send_lengt...
functions
else if (ctepr == 0) { /* * If someone issues STOP bit of command register at run time, * the TX machine will stop the current transmission and the * CTEPR register will be reset to zero. * This is just precautionary measures. */ if (ax_local->tx_prev_ctepr != 0) { ax_local->tx_curr_page = ax_loc...
functions
else if (ctepr < ax_local->tx_curr_page - 1) { free_pages = ax_local->tx_stop_page - ax_local->tx_curr_page + ctepr - ax_local->tx_start_page + 1; }
functions
else if (ctepr > ax_local->tx_curr_page - 1) { free_pages = ctepr + 1 - ax_local->tx_curr_page; }
functions
else if (ctepr == ax_local->tx_curr_page - 1) { if (ax_local->tx_full) free_pages = 0; else free_pages = TX_PAGES; }
functions
void ax_tx_intr (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; int status = readb (ax_base + EN0_TSR); ax_local->tx_full = 0; if (netif_queue_stopped (ndev)) netif_wake_queue (ndev); /* Minimize Tx latency: update the statistics after we rest...
functions
void ax_tx_err (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned char txsr = readb (ax_base+EN0_TSR); unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); if (tx_was_aborted) ax_tx_intr (ndev); else { ax_local->stat.tx_errors++...
functions
int ax88796b_open (struct net_device *ndev) { unsigned long flags; struct ax_device *ax_local = ax_get_priv (ndev); int ret = 0; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); ret = request_irq (ndev->irq, &ax_interrupt, 0, ndev->name, ndev); if (ret) { PRINTK (ERROR_MSG, PFX " unable...
functions
int ax88796b_close (struct net_device *ndev) { struct ax_device *ax_local = ax_get_priv (ndev); unsigned long flags; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); del_timer_sync (&ax_local->watchdog); spin_lock_irqsave (&ax_local->page_lock, flags); ax88796b_init (ndev, 0); free_irq (nd...
functions
int ax_probe (struct net_device *ndev, struct ax_device *ax_local) { int i; int reg0; void *ax_base = ax_local->membase; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); reg0 = readb (ax_base); if (reg0 == 0xFF) { return -ENODEV; }
functions
int ax88796b_drv_probe(struct platform_device *pdev) { struct ax_device *ax_local; struct resource *res = NULL; void *addr; int ret; struct net_device *ndev; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); /* User can overwrite AX88796B's base address */ if (!mem){ res = platform_get_re...
functions
int ax88796b_suspend(struct platform_device *p_dev, pm_message_t state) { struct net_device *ndev = dev_get_drvdata(&(p_dev)->dev); struct ax_device *ax_local = ax_get_priv (ndev); void *ax_base = ax_local->membase; unsigned long flags; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); if (!nd...
functions
int ax88796b_resume (struct platform_device *p_dev) { struct net_device *ndev = dev_get_drvdata(&(p_dev)->dev); struct ax_device *ax_local = netdev_priv (ndev); void __iomem *ax_base = ax_local->membase; unsigned long flags; int ret; u8 pme; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); ...
functions
else if (pme & ENWUCS_MPR) { PRINTK (DEBUG_MSG, PFX " Waked by magic packet\n"); }
functions
__devexit ax88796b_exit_module(struct platform_device *pdev) { struct net_device *ndev = platform_get_drvdata (pdev); struct ax_device *ax_local = netdev_priv (ndev); void __iomem *ax_base = ax_local->membase; PRINTK (DEBUG_MSG, PFX " %s beginning ..........\n", __FUNCTION__); platform_set_drvdata (pdev, NULL); ...
functions
__init ax88796b_init_mod(void) { return platform_driver_register (&ax88796b_driver); }
functions
__exit ax88796b_cleanup(void) { /* Unregister platform driver*/ platform_driver_unregister (&ax88796b_driver); }
includes
#include <signal.h>
includes
#include <unistd.h>
includes
#include <sys/time.h>
includes
#include <sys/wait.h>
includes
#include <pwd.h>
includes
#include <locale.h>
includes
#include <grp.h>
functions
else if( global.conf->runmode == RUNMODE_DAEMON ) { log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); i = bitlbee_daemon_init(); log_message( LOGLVL_INFO, "%s %s starting in daemon mode.", PACKAGE, BITLBEE_VERSION ); }
functions
else if( global.conf->runmode == RUNMODE_FORKDAEMON ) { log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); /* In case the operator requests a restart, we need this. */ old_cwd = g_malloc( 256 ); if( getcwd( old_cwd, 255 ) == NULL ) { log_message( LOGLVL_WARNING,...
functions
int crypt_main( int argc, char *argv[] ) { int pass_len; unsigned char *pass_cr, *pass_cl; if( argc < 4 || ( strcmp( argv[2], "hash" ) != 0 && strcmp( argv[2], "unhash" ) != 0 && argc < 5 ) ) { printf( "Supported:\n" " %s -x enc <key> <cleartext password>\n" " %s -x dec ...
functions
void sighandler_shutdown( int signal ) { /* Write a single null byte to the pipe, just to send a message to the main loop. * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */ write( signal_shutdown_pipe[1], "", 1 ); }
functions
void sighandler_crash( int signal ) { GSList *l; const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n"; int len = strlen(message); for (l = irc_connection_list; l; l = l->next ) { irc_t *irc = l->data; write( irc->fd, message, len ); }
functions
double gettime() { struct timeval time[1]; gettimeofday( time, 0 ); return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); }
main
int main( int argc, char *argv[] ) { int i = 0; char *old_cwd = NULL; struct sigaction sig, old; /* Required to make iconv to ASCII//TRANSLIT work. This makes BitlBee system-locale-sensitive. :-( */ setlocale( LC_CTYPE, "" ); if( argc > 1 && strcmp( argv[1], "-x" ) == 0 ) return crypt_main( argc, argv )...
includes
#include <zend_exceptions.h>
functions
void redis_pool_add(redis_pool *pool, RedisSock *redis_sock, int weight, int database, char *prefix, char *auth TSRMLS_DC) { redis_pool_member *rpm = ecalloc(1, sizeof(redis_pool_member)); rpm->redis_sock = redis_sock; rpm->weight = weight; rpm->database = database; rpm->prefix = prefix; r...
functions
void redis_pool_free(redis_pool *pool TSRMLS_DC) { redis_pool_member *rpm, *next; rpm = pool->head; while(rpm) { next = rpm->next; redis_sock_disconnect(rpm->redis_sock TSRMLS_CC); efree(rpm->redis_sock); if(rpm->prefix) efree(rpm->prefix); if(rpm->auth) efree(rpm->auth); efree(rpm); rpm = next; }
functions
void redis_pool_member_auth(redis_pool_member *rpm TSRMLS_DC) { RedisSock *redis_sock = rpm->redis_sock; char *response, *cmd; int response_len, cmd_len; if(!rpm->auth || !rpm->auth_len) { /* no password given. */ return; }
functions
void redis_pool_member_select(redis_pool_member *rpm TSRMLS_DC) { RedisSock *redis_sock = rpm->redis_sock; char *response, *cmd; int response_len, cmd_len; cmd_len = redis_cmd_format_static(&cmd, "SELECT", "d", rpm->database); if(redis_sock_write(redis_sock, cmd, cmd_len TSRMLS_CC) >= 0) { ...
includes
#include <asm/machdep.h>
includes
#include <asm/pci-bridge.h>