type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define H_TO_INTL(member) \
functions
void mutt_autocrypthdr_free(struct AutocryptHeader **p) { if (!p) return; struct AutocryptHeader *cur = NULL; while (*p) { cur = *p; *p = (*p)->next; FREE(&cur->addr); FREE(&cur->keydata); FREE(&cur); }
functions
void mutt_env_free(struct Envelope **ptr) { if (!ptr || !*ptr) return; struct Envelope *env = *ptr; mutt_addrlist_clear(&env->return_path); mutt_addrlist_clear(&env->from); mutt_addrlist_clear(&env->to); mutt_addrlist_clear(&env->cc); mutt_addrlist_clear(&env->bcc); mutt_addrlist_clear(&env->sende...
functions
bool mutt_env_notify_send(struct Email *e, enum NotifyEnvelope type) { struct EventEmail ev_e = { 1, &e }
functions
void mutt_env_merge(struct Envelope *base, struct Envelope **extra) { if (!base || !extra || !*extra) return; /* copies each existing element if necessary, and sets the element * to NULL in the source so that mutt_env_free doesn't leave us * with dangling pointers. */ if (!base->member) ...
functions
bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2) { if (e1 && e2) { if (!mutt_str_equal(e1->message_id, e2->message_id) || !mutt_str_equal(e1->subject, e2->subject) || !mutt_list_compare(&e1->references, &e2->references) || !mutt_addrlist_equal(&e1->from, &e2...
functions
void mutt_env_to_local(struct Envelope *env) { if (!env) return; mutt_addrlist_to_local(&env->return_path); mutt_addrlist_to_local(&env->from); mutt_addrlist_to_local(&env->to); mutt_addrlist_to_local(&env->cc); mutt_addrlist_to_local(&env->bcc); mutt_addrlist_to_local(&env->reply_to); mutt_addrlis...
functions
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err) { if (!env) return 1; int rc = 0; H_TO_INTL(return_path); H_TO_INTL(from); H_TO_INTL(to); H_TO_INTL(cc); H_TO_INTL(bcc); H_TO_INTL(reply_to); H_TO_INTL(mail_followup_to); return rc; }
includes
#include <linux/config.h>
includes
#include <linux/types.h>
includes
#include <linux/init.h>
includes
#include <linux/delay.h>
includes
#include <linux/kernel.h>
includes
#include <linux/sched.h>
includes
#include <linux/spinlock.h>
includes
#include <linux/adb.h>
includes
#include <linux/pmu.h>
includes
#include <linux/ioport.h>
includes
#include <linux/pci.h>
includes
#include <asm/sections.h>
includes
#include <asm/errno.h>
includes
#include <asm/ohare.h>
includes
#include <asm/heathrow.h>
includes
#include <asm/keylargo.h>
includes
#include <asm/uninorth.h>
includes
#include <asm/io.h>
includes
#include <asm/prom.h>
includes
#include <asm/machdep.h>
includes
#include <asm/pmac_feature.h>
includes
#include <asm/dbdma.h>
includes
#include <asm/pci-bridge.h>
includes
#include <asm/pmac_low_i2c.h>
defines
#define DBG(fmt,...) printk(KERN_DEBUG fmt)
defines
#define DBG(fmt,...)
defines
#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
defines
#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
defines
#define UN_REG(r) (uninorth_base + ((r) >> 2))
defines
#define UN_IN(r) (in_be32(UN_REG(r)))
defines
#define UN_OUT(r,v) (out_be32(UN_REG(r), (v)))
defines
#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
defines
#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
structs
struct feature_table_entry { unsigned int selector; feature_call function; };
structs
struct pmac_mb_def { const char* model_string; const char* model_name; int model_id; struct feature_table_entry* features; unsigned long board_flags; };
functions
int simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value) { struct macio_chip* macio; unsigned long flags; macio = macio_find(node, type); if (!macio) return -ENODEV; LOCK(flags); if (value) MACIO_BIS(reg, mask); else MACIO_BIC(reg, mask); (void)MACIO_IN32(reg); UNLOCK(...
functions
long ohare_htw_scc_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long chan_mask; unsigned long fcr; unsigned long flags; int htw, trans; unsigned long rmask; macio = macio_find(node, 0); if (!macio) return -ENODEV; if (!strcmp(node->name, "ch-a")) chan...
functions
long ohare_floppy_enable(struct device_node* node, long param, long value) { return simple_feature_tweak(node, macio_ohare, OHARE_FCR, OH_FLOPPY_ENABLE, value); }
functions
long ohare_mesh_enable(struct device_node* node, long param, long value) { return simple_feature_tweak(node, macio_ohare, OHARE_FCR, OH_MESH_ENABLE, value); }
functions
long ohare_ide_enable(struct device_node* node, long param, long value) { switch(param) { case 0: /* For some reason, setting the bit in set_initial_features() * doesn't stick. I'm still investigating... --BenH. */ if (value) simple_feature_tweak(node, macio_ohare, OHARE_FCR, ...
functions
long ohare_ide_reset(struct device_node* node, long param, long value) { switch(param) { case 0: return simple_feature_tweak(node, macio_ohare, OHARE_FCR, OH_IDE0_RESET_N, !value); case 1: return simple_feature_tweak(node, macio_ohare, OHARE_FCR, OH_IDE1_RESET_N, !value); default: return...
functions
long ohare_sleep_state(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) return -EPERM; if (value == 1) { MACIO_BIC(OHARE_FCR, OH_IOBUS_ENABLE); }
functions
else if (value == 0) { MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); }
functions
long heathrow_modem_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; u8 gpio; unsigned long flags; macio = macio_find(node, macio_unknown); if (!macio) return -ENODEV; gpio = MACIO_IN8(HRW_GPIO_MODEM_RESET) & ~1; if (!value) { LOCK(flags); MACIO_OUT8(HRW_GPIO_MODEM_R...
functions
long heathrow_floppy_enable(struct device_node* node, long param, long value) { return simple_feature_tweak(node, macio_unknown, HEATHROW_FCR, HRW_SWIM_ENABLE|HRW_BAY_FLOPPY_ENABLE, value); }
functions
long heathrow_mesh_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; macio = macio_find(node, macio_unknown); if (!macio) return -ENODEV; LOCK(flags); /* Set clear mesh cell enable */ if (value) MACIO_BIS(HEATHROW_FCR, HRW_MESH_ENABLE); else MACIO_...
functions
long heathrow_ide_enable(struct device_node* node, long param, long value) { switch(param) { case 0: return simple_feature_tweak(node, macio_unknown, HEATHROW_FCR, HRW_IDE0_ENABLE, value); case 1: return simple_feature_tweak(node, macio_unknown, HEATHROW_FCR, HRW_BAY_IDE_ENABLE, value); defaul...
functions
long heathrow_ide_reset(struct device_node* node, long param, long value) { switch(param) { case 0: return simple_feature_tweak(node, macio_unknown, HEATHROW_FCR, HRW_IDE0_RESET_N, !value); case 1: return simple_feature_tweak(node, macio_unknown, HEATHROW_FCR, HRW_IDE1_RESET_N, !value); defaul...
functions
long heathrow_bmac_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; macio = macio_find(node, 0); if (!macio) return -ENODEV; if (value) { LOCK(flags); MACIO_BIS(HEATHROW_FCR, HRW_BMAC_IO_ENABLE); MACIO_BIS(HEATHROW_FCR, HRW_BMAC_RESET); UNLOCK(fl...
functions
long heathrow_sound_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; /* B&W G3 and Yikes don't support that properly (the * sound appear to never come back after beeing shut down). */ if (pmac_mb.model_id == PMAC_TYPE_YOSEMITE || pmac_mb.model_id =...
functions
void dbdma_save(struct macio_chip* macio, struct dbdma_regs* save) { int i; /* Save state & config of DBDMA channels */ for (i=0; i<13; i++) { volatile struct dbdma_regs __iomem * chan = (void __iomem *) (macio->base + ((0x8000+i*0x100)>>2)); save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi); save[i].cmdptr = ...
functions
void dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save) { int i; /* Save state & config of DBDMA channels */ for (i=0; i<13; i++) { volatile struct dbdma_regs __iomem * chan = (void __iomem *) (macio->base + ((0x8000+i*0x100)>>2)); out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16...
functions
void heathrow_sleep(struct macio_chip* macio, int secondary) { if (secondary) { dbdma_save(macio, save_alt_dbdma); save_fcr[2] = MACIO_IN32(0x38); save_fcr[3] = MACIO_IN32(0x3c); }
functions
void heathrow_wakeup(struct macio_chip* macio, int secondary) { if (secondary) { MACIO_OUT32(0x38, save_fcr[2]); (void)MACIO_IN32(0x38); mdelay(1); MACIO_OUT32(0x3c, save_fcr[3]); (void)MACIO_IN32(0x38); mdelay(10); dbdma_restore(macio, save_alt_dbdma); }
functions
long heathrow_sleep_state(struct device_node* node, long param, long value) { if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) return -EPERM; if (value == 1) { if (macio_chips[1].type == macio_gatwick) heathrow_sleep(&macio_chips[0], 1); heathrow_sleep(&macio_chips[0], 0); }
functions
else if (value == 0) { heathrow_wakeup(&macio_chips[0], 0); if (macio_chips[1].type == macio_gatwick) heathrow_wakeup(&macio_chips[0], 1); }
functions
long core99_scc_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; unsigned long chan_mask; u32 fcr; macio = macio_find(node, 0); if (!macio) return -ENODEV; if (!strcmp(node->name, "ch-a")) chan_mask = MACIO_FLAG_SCCA_ON; else if (!strcmp(node->na...
functions
long core99_modem_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; u8 gpio; unsigned long flags; /* Hack for internal USB modem */ if (node == NULL) { if (macio_chips[0].type != macio_keylargo) return -ENODEV; node = macio_chips[0].of_node; }
functions
long pangea_modem_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; u8 gpio; unsigned long flags; /* Hack for internal USB modem */ if (node == NULL) { if (macio_chips[0].type != macio_pangea && macio_chips[0].type != macio_intrepid) return -ENODEV; node = macio_...
functions
long core99_ata100_enable(struct device_node* node, long value) { unsigned long flags; struct pci_dev *pdev = NULL; u8 pbus, pid; if (uninorth_rev < 0x24) return -ENODEV; LOCK(flags); if (value) UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100); else UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA1...
functions
long core99_ide_enable(struct device_node* node, long param, long value) { /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2 * based ata-100 */ switch(param) { case 0: return simple_feature_tweak(node, macio_unknown, KEYLARGO_FCR1, KL1_EIDE0_ENABLE, value); case 1: return simple_feature_twea...
functions
long core99_ide_reset(struct device_node* node, long param, long value) { switch(param) { case 0: return simple_feature_tweak(node, macio_unknown, KEYLARGO_FCR1, KL1_EIDE0_RESET_N, !value); case 1: return simple_feature_tweak(node, macio_unknown, KEYLARGO_FCR1, KL1_EIDE1_RESET_N, !value); case...
functions
long core99_gmac_enable(struct device_node* node, long param, long value) { unsigned long flags; LOCK(flags); if (value) UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC); else UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC); (void)UN_IN(UNI_N_CLOCK_CNTL); UNLOCK(flags); udelay(20); return 0; }
functions
long core99_gmac_phy_reset(struct device_node* node, long param, long value) { unsigned long flags; struct macio_chip* macio; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->type != macio_pangea && macio->type != macio_intrepid) return -ENODEV; LOCK(flags); MACIO_OUT8(KL_GPIO_ETH_PHY...
functions
long core99_sound_chip_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; macio = macio_find(node, 0); if (!macio) return -ENODEV; /* Do a better probe code, screamer G4 desktops & * iMacs can do that too, add a recalibrate in * the driver as well ...
functions
long core99_airport_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; int state; macio = macio_find(node, 0); if (!macio) return -ENODEV; /* Hint: we allow passing of macio itself for the sake of the * sleep code */ if (node != macio->of_node && ...
functions
long core99_reset_cpu(struct device_node* node, long param, long value) { unsigned int reset_io = 0; unsigned long flags; struct macio_chip* macio; struct device_node* np; const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0, KL_GPIO_RESET_CPU1, KL_GPIO_RESET_CPU2, KL_GPIO_RESET_CPU3 }
functions
long core99_usb_enable(struct device_node* node, long param, long value) { struct macio_chip* macio; unsigned long flags; char* prop; int number; u32 reg; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->type != macio_pangea && macio->type != macio_intrepid) return -ENODEV; prop = (...
functions
else if (number == 2) { MACIO_BIC(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1)); UNLOCK(flags); (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); LOCK(flags); MACIO_BIS(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE); }
functions
else if (number == 4) { MACIO_BIC(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1)); UNLOCK(flags); (void)MACIO_IN32(KEYLARGO_FCR1); mdelay(1); LOCK(flags); MACIO_BIS(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE); }
functions
else if (number == 2) { if (macio->type != macio_intrepid) MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE); (void)MACIO_IN32(KEYLARGO_FCR0); udelay(1); MACIO_BIS(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1)); (void)MACIO_IN32(KEYLARGO_FCR0); }
functions
else if (number == 4) { udelay(1); MACIO_BIS(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1)); (void)MACIO_IN32(KEYLARGO_FCR1); }
functions
long core99_firewire_enable(struct device_node* node, long param, long value) { unsigned long flags; struct macio_chip* macio; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->type != macio_pangea && macio->type != macio_intrepid) return -ENODEV; if (!(macio->flags & MACIO_FLAG_FW_SUPPO...
functions
long core99_firewire_cable_power(struct device_node* node, long param, long value) { unsigned long flags; struct macio_chip* macio; /* Trick: we allow NULL node */ if ((pmac_mb.board_flags & PMAC_MB_HAS_FW_POWER) == 0) return -ENODEV; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->typ...
functions
long intrepid_aack_delay_enable(struct device_node* node, long param, long value) { unsigned long flags; if (uninorth_rev < 0xd2) return -ENODEV; LOCK(flags); if (param) UN_BIS(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); else UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); UNLOCK(flags); retu...
functions
long core99_read_gpio(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; return MACIO_IN8(param); }
functions
long core99_write_gpio(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; MACIO_OUT8(param, (u8)(value & 0xff)); return 0; }
functions
long g5_gmac_enable(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; u8 pbus, pid; LOCK(flags); if (value) { MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE); mb(); k2_skiplist[0] = NULL; }
functions
long g5_fw_enable(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; LOCK(flags); if (value) { MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE); mb(); k2_skiplist[1] = NULL; }
functions
long g5_mpic_enable(struct device_node* node, long param, long value) { unsigned long flags; if (node->parent == NULL || strcmp(node->parent->name, "u3")) return 0; LOCK(flags); UN_BIS(U3_TOGGLE_REG, U3_MPIC_RESET | U3_MPIC_OUTPUT_ENABLE); UNLOCK(flags); return 0; }
functions
long g5_reset_cpu(struct device_node* node, long param, long value) { unsigned int reset_io = 0; unsigned long flags; struct macio_chip* macio; struct device_node* np; macio = &macio_chips[0]; if (macio->type != macio_keylargo2) return -ENODEV; np = find_path_device("/cpus"); if (np == NULL) return -ENODE...
functions
void g5_phy_disable_cpu1(void) { UN_OUT(U3_API_PHY_CONFIG_1, 0); }
functions
void keylargo_shutdown(struct macio_chip* macio, int sleep_mode) { u32 temp; if (sleep_mode) { mdelay(1); MACIO_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND); (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); }
functions
void pangea_shutdown(struct macio_chip* macio, int sleep_mode) { u32 temp; MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE | KL0_SCC_CELL_ENABLE | KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE); MACIO_BIC(KEYLARGO_FCR1, KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT | KL1_AUDIO_CLK_OUT_ENABLE ...
functions
void intrepid_shutdown(struct macio_chip* macio, int sleep_mode) { u32 temp; MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE | KL0_SCC_CELL_ENABLE); MACIO_BIC(KEYLARGO_FCR1, /*KL1_USB2_CELL_ENABLE |*/ KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT | KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE | ...
functions
void pmac_tweak_clock_spreading(int enable) { struct macio_chip* macio = &macio_chips[0]; /* Hack for doing clock spreading on some machines PowerBooks and * iBooks. This implements the "platform-do-clockspreading" OF * property as decoded manually on various models. For safety, we also * check the product ID ...
functions
int core99_sleep(void) { struct macio_chip* macio; int i; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->type != macio_pangea && macio->type != macio_intrepid) return -ENODEV; /* We power off the wireless slot in case it was not done * by the driver. We don't power it on automatica...
functions
int core99_wake_up(void) { struct macio_chip* macio; int i; macio = &macio_chips[0]; if (macio->type != macio_keylargo && macio->type != macio_pangea && macio->type != macio_intrepid) return -ENODEV; /* * Wakeup the host bridge */ UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_NORMAL); udelay(10); UN_OUT(...
functions
long core99_sleep_state(struct device_node* node, long param, long value) { /* Param == 1 means to enter the "fake sleep" mode that is * used for CPU speed switch */ if (param == 1) { if (value == 1) { UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING); UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_IDLE2);...
functions
long generic_dev_can_wake(struct device_node* node, long param, long value) { /* Todo: eventually check we are really dealing with on-board * video device ... */ if (pmac_mb.board_flags & PMAC_MB_MAY_SLEEP) pmac_mb.board_flags |= PMAC_MB_CAN_SLEEP; return 0; }
functions
long generic_get_mb_info(struct device_node* node, long param, long value) { switch(param) { case PMAC_MB_INFO_MODEL: return pmac_mb.model_id; case PMAC_MB_INFO_FLAGS: return pmac_mb.board_flags; case PMAC_MB_INFO_NAME: /* hack hack hack... but should work */ *((const char **)value) = pmac_mb.model_n...
functions
long pmac_do_feature_call(unsigned int selector, ...) { struct device_node* node; long param, value; int i; feature_call func = NULL; va_list args; if (pmac_mb.features) for (i=0; pmac_mb.features[i].function; i++) if (pmac_mb.features[i].selector == selector) { func = pmac_mb.features[i].function; ...